Microsoft has announced the general availability of static websites on Azure Storage, which provides the ability to serve content from HTML, CSS and JavaScript files hosted on Azure Storage. Static websites contain web pages with fixed content, while still allowing to leverage client-side code like JavaScript to create a rich user experience.
With this new capability, Microsoft brings the serverless paradigm to the website space as well, following services such as Azure Functions for compute, Event Grid for messaging, and Logic Apps for workflow. Consequently, static websites on Azure Storage provide us with the advantages of serverless applications, including pay-per-use billing, automatic scaling, and abstraction of the underlying infrastructure. Other cloud providers offer similar services for hosting static websites on their platforms as well. For example, AWS with Amazon S3 which has incorporated this feature for quite some time.
Only able to serve static content, static websites are meant for a specific subset of website scenarios. However, as there is always the option to make calls to other services by calling their endpoints from the client-side code, it is possible to interact with other systems. Gunnar Peipman, Microsoft ASP.NET MVP and owner of Peipman Consult, explains in which situations this would be the best fit solution:
- Landing pages for products, events and promotions. These pages are often one-time craft work that look beautiful and look attractive to visitors. Often these pages come from sales and marketing agencies. They are just a zip archive with set of files that doesn't communicate with back-end systems.
- Offsite CMS - some companies build their sites on some server hosted in their LAN. Although CMS there is fully dynamic, the site itself is hosted as static one. After modification site is published to some folder and uploaded to server. There are government offices that use this strategy to have minimal number of risk vectors in public space.
- Single Page Applications (SPA) - SPA-s may come as pure static sites that use background web services to communicate with server. The backend can be Web API application or set of Azure Functions.
Hosting a static website on Azure Storage is possible with just a flick of a button on the storage account, which then generates the endpoints serving the content. Enabling this option creates a container for hosting the files. Subsequently, once the content is uploaded in this container, provide the name of the index page here, and optionally a custom error page as well. Additionally, the documentation provides a step by step guidance on how to get started.
Source: https://azure.microsoft.com/en-us/blog/azure-storage-static-web-hosting-public-preview/
As all this runs on Azure Storage, there is also the opportunity to leverage several other options on these static websites. For instance, by configuring a custom domain, they can be available under any registered domain name. To enable the use of SSL in combination with a custom domain, there is the possibility to use Azure CDN, allowing to serve the pages over HTTPS. Finally, by taking advantage of the Azure Search capabilities, it is possible to incorporate search features into the web pages easily.