In this article, we will explore the process of migrating a static website to Azure using Azure Blob Storage.
Navigate to the Azure portal and click on “Storage Accounts” or use the search bar to locate and select “Storage Accounts.” Then, click on “Add.”
For the purpose of this blog post, we will keep the Region and Performance settings at their default values. However, it’s important to familiarize yourself with these options and adjust them according to your requirements. Note that the Account kind must remain as “StorageV2” to enable hosting of a static website. Additionally, consider modifying the Location if you do not plan to utilize Azure CDN.
![](/wp-content/uploads/2024/07/Screenshot_1-1.jpg)
To leverage the power of Azure Blob Storage for hosting your static website, you first need to enable static website hosting on your storage account. Navigate to the account’s Overview pane and select the Capabilities tab. Here, you’ll find the option to enable Static Website hosting.
![](/wp-content/uploads/2024/07/Screenshot_2-1-1024x440.jpg)
Once enabled, specify the default index document (e.g., index.html) and error document (e.g., 404.html). Click ‘Save’ to finalize the configuration, and your static website will be ready to serve content efficiently from Azure Blob Storage.
![](/wp-content/uploads/2024/07/Screenshot_3-1-1024x762.jpg)
Next, I uploaded the website content.
![](/wp-content/uploads/2024/07/Screenshot_4-1.jpg)
And the site was live! Unfortunately, I made a mistake, and instead of opening the website pages, they were being downloaded. So, let’s take a look at this issue
![](/wp-content/uploads/2024/07/Screenshot_5-1-1024x189.jpg)
The issue arose because the content-type of the files was not set to text/html, so I had to update this setting for all files.
![](/wp-content/uploads/2024/07/Screenshot_8-2-1024x103.jpg)