Static HTML Web Sites in Azure Storage
Organizations may want to host their static web sites in normal storage for many reasons. In my case, I am looking to host a static site in an Azure Storage, generated by AngularJS, for the following reasons:
- Minimal cost – Storage charges at a per/GB rate, unlike other services like Azure App Service where I need to pay a $/hour x # of instances.
- Maximize concurrent user requests per second – Azure Storage can be easily configured to be delivered through Azure CDN, which optimizes my distribution and delivery. From experience, CDN typically helps offload the origin traffic by 90%.
The challenge is that Azure Storage does not redirect users to the default index.html by default. (i.e. going to http://www.mystoragedomain.com does not automatically redirect the user to http://www.mystoragedomain.com/index.html).
This blog post is to describe the current 2 methods on how to do this:
Option 1: Static Website Hosting in Azure Storage
In public preview as of today, you can enable the Static Website feature in a General Purpose v2 storage account. Read more here.
Option 2: Use Azure CDN Premium Rules
This is the more traditional method before Option 1 was released. Provision an Azure CDN with Pricing Tier = Verizon Premium. Using this CDN’s advanced features, you are able to redirect users to the default index.html.
Now on this topic, I have read and tried many other blog posts. The best one I found is by Hao Luo in his blog post here (Dear Hao, if you’re reading this, thank you for your contribution to the community!).