Host Static Websites Using Azure Storage

October 28, 2022

By Anju Thomas

Static Websites

Static Websites as everyone knows, are displayed in a web browser exactly as it is stored. It is very light weight and only requires a web server for functioning. It is helpful for use cases such as blogs, restaurant menus etc. where the content remains fixed.  As the name suggests these websites do not change, it remains "static" for every viewer of the site. Compared to dynamic websites, they are quick to set up, cost-effective and do not have the overhead of high-level programming and database design. In this blog we will be discussing how to host a static website in Azure Storage.

Hosting A Static Website Using Azure Storage

1. Log into azure portal.

2. Create a storage account.

Screenshot of the Create storage account dashboard in Azure

3. Once deployment is completed, go to static website within the storage account. Enable it and update the index document name and the error document name with the names from your website files.

Screenshot of the Static website setting in Azure

Screenshot of the Static website (preview) setting in Azure

4. Once its saved a primary endpoint is created which is the basically the url of the website. If we access the url now we get an error as in image below because we have not uploaded the website files in Azure.

Screenshot of a "The requested content does not exist" error message

5. When we go back to the portal there is a container provisioned by azure for storing the files for the website called $web. On clicking the $web we are taken to the container where we upload the files as in the below image.

Screenshot of the web container upload dashboard in Azure

Screenshot of the file upload container in Azure

6. Once the files are successfully uploaded, hitting the endpoint again will load our website.

Thanks for reading through and I hope you find my little blog informative!

Anju Headshot

Anju Thomas

Sitecore Web Developer

Anju is a Sitecore Developer with a Bachelor's Degree in Computer Science and over 4 years of experience in Sitecore development. She loves solving Sudoku puzzles, watching movies, eating delicious food and exploring the world.