Kirsten
Kirsten

Reputation: 18066

The requested URI does not represent any resource on the server

I am trying to host a website in Azure Blob Storage as discussed here

I have had success with www.mysite.com.au which is redirecting to
( where mysite is not the real name )

http://docs.mysite.com.au/site/index.html ( not a real url )

where docs is a cname with the alias being the blob storage name.

The blob access policy is set to Container

The direct link in Azure is https://mysite.blob.core.windows.net/site/index.html (not the real name)

I am puzzled as to why I cannot go to http://docs.mysite.com.au/site/index.html directly

When I do this I get an error

The requested URI does not represent any resource on the server

I think the answer might be to do with working with blobs not files. Similar to why "subfolders" cant be created in $root.

[Update] I also ran into this problem when I deleted index.html and then re-uploaded it. I can see the file in storage explorer. I think I will need to revert to an app service.

Upvotes: 2

Views: 28941

Answers (3)

Jan Cizmar
Jan Cizmar

Reputation: 365

What you can also do as a workaround is setting up an Front Door and CDN profile and set it's origin path to some other path.

E.g. you can create a container data, where you can create subfolders. Then you can set origin path of the Front Door to data so the root of the CDN will point to root of your data container.

Upvotes: 0

Kirsten
Kirsten

Reputation: 18066

I think I must have had the custom name set incorrectly in Azure. It should have been docs.mysite.com.au ( not the real name)

Upvotes: 0

Bruce Chen
Bruce Chen

Reputation: 18465

For hosting static website on Azure Blob Storage, you could leverage the root container ($root) and store your files under the root path as follows:

https://brucchstorage.blob.core.windows.net/index.html
Custom domain: http://brucestorage.conforso.org/index.html

For script and css files, you could create another container (e.g. content), then put script files under content/script/ and css files under content/css/ or you could create each container for storing script and css files.

https://brucchstorage.blob.core.windows.net/content/css/bootstrap.min.css
https://brucchstorage.blob.core.windows.net/content/script/bootstrap.min.js

The requested URI does not represent any resource on the server

AFAIK, the blob in the root container cannot include a forward slash (/) in its name. If you upload blob into root container with the / in its name, then you would retrieve this error.

Upvotes: 2

Related Questions