Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Howto upload/setup default.html page for Azure Blob Storage?

First, how to upload a file to blob root? It seems I have to upload file to a container (which is a folder IMO)

Second, if I finally found a way to upload file to root, will default.html page (or other name) become the default page for the domain?

Thanks.

like image 758
Eric Yin Avatar asked Dec 26 '11 22:12

Eric Yin


People also ask

How do I host an HTML site on Azure?

Configure static website hostingOpen the Azure portal in your web browser. Locate your storage account and display the account overview. Select Static website to display the configuration page for static websites. Select Enabled to enable static website hosting for the storage account.

How do I get BLOB storage URL?

By default, the URL for accessing the Blob service in a storage account is https://<your account name>. blob.core.windows.net. You can map your own domain or subdomain to the Blob service for your storage account so that users can reach it using the custom domain or subdomain.


Video Answer


4 Answers

There is a container named: $root. Refer to 'Working with the Root Container' for further info

AFAIK, blob storage cannot be used as a simple web server, so it cannot serve default.html. You will need a web role instance for this.Windows Azure Web, Worker, and VM roles demystified

like image 195
santiagoIT Avatar answered Oct 30 '22 18:10

santiagoIT


There's a special container name, $root, that you use for writing to the root container. See this MSDN article for more information about this root container.

While you can store static web content in blob storage, there's no concept of a default object; that is, you can't have something like default.html be served when a visiter heads over to www.YourStaticSite.com. They'd need to visit www.YourStaticSite.com/default.html.

EDIT: As @SantiagoIT mentioned, you need to host your default page somewhere (such as a Web Role). Since you can move static content to blob storage (e.g. css, javascript, images, and static html), this will reduce the load on your Web Role instances (since requests to blob storage go directly to blob storage, bypassing your Web Role instances altogether). Even if your website is hosted on-premises, you could take advantage of blob storage, yielding the same advantages.

Going one step further: once content is in blob storage, you can choose to activate the CDN (edge cache). For frequently-accessed content, this could yield a performance gain for your end-users.

like image 42
David Makogon Avatar answered Oct 30 '22 18:10

David Makogon


Others have noted the $root container and also that there is currently no concept of a default blob.

I agree that it would be super useful to suport a default blob for each container including the root container.

I have an open feature request on this. http://feedback.azure.com/forums/217298-storage/suggestions/1180039-support-a-default-blob-for-blob-storage-containers#comments

like image 36
Chris J.T. Auld Avatar answered Oct 30 '22 19:10

Chris J.T. Auld


One of the motivations to add $root folder to blob storage was to support Silverlight's clientaccesspolicy.xml file as explained in MSDN documentation

like image 43
benjguin Avatar answered Oct 30 '22 18:10

benjguin