1

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.

Kirsten
  • 15,730
  • 41
  • 179
  • 318

2 Answers2

2

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.

Bruce Chen
  • 18,207
  • 2
  • 21
  • 35
  • A nice work around for $root not being able to contain folders However I was not working with $root. I updated the question to show that I can see the file in storage explorer. – Kirsten Jan 04 '18 at 06:30
  • For example `http://docs.mysite.com.au/site/index.html`, the `site` is your container name, the blob name is `index.html`, you may access your resource via the browser. Here is my script sample: http://brucestorage.conforso.org/content/script/bootstrap.min.js, please check your resource link. – Bruce Chen Jan 04 '18 at 06:36
  • Oh dear, I have actually deleted the site now, I got so frustrated sorry. However as per the question, the file could be accessed by the Azure link so it did exist. It just could not be accessed by the link involving the domain name. – Kirsten Jan 04 '18 at 08:47
  • I didn't realize (until now) that `$root` is a special folder that can't have sub folders. That explains all the error messages I was getting when attempting to upload files to virtual folders below `$root`. – PoorInRichfield Feb 26 '19 at 15:24
0

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)

Kirsten
  • 15,730
  • 41
  • 179
  • 318