Search code examples
azureazure-storageazure-web-roles

Azure Blob Storage as Web Role Virtual Directory?


Is it possible to have a web role in an Azure Cloud Service with a Virtual Directory that points to blob storage?

My scenario: I'm looking into migrating my company's web sites to Azure. Currently we use blog platform that publishes its content as static files, and we have a "/blog" virtual directory from our web site pointing to the location of these files. It would be nice if I could install the blog platform on a VM and have it publish to a location that could be mapped to a virtual dir. I see where it's possible to have a virtual hard drive on a Virtual Machine, but I can't find a mention of this being possible from a cloud service.


Solution

  • Take a look here: http://www.windowsazure.com/en-us/manage/services/storage/custom-dns-storage/. You could possibly map a blob container (let's call it blogs) as a virtual directory using CNAME mapping. However, please do keep in mind that blob storage is still an object store and not a web server thus you won't be able to:

    • Provide a default document for your virtual directory i.e. you can't do http://yourcompanyname.com/blog and have it load a default document.
    • Provide custom error message pages e.g. 404 error page. You will get a page which will show raw XML saying resource not found.

    Amazon S3 (Windows Azure Blob Storage counterpart) allows you to host static websites in buckets. See if that would work for you. More details can be found here: http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html.