Reading Time: 3 minutes
Share:
Twitter
LinkedIn
Facebook
Reddit
Whatsapp
Follow by Email

A relativity new feature in Azure is the ability to host a static website in Azure storage. This can be handy if you just need to host a simple website cheaply and with little configuration. Although the websites code needs to be static you can use some Azure resources to perform backend processes. Below I will show you how to host a simple static web page using Azure storage.

Storage Account Configuration

First, you will need a storage account. The storage account needs to be a General Purpose v2. You can create one using the portal, PowerShell, or the CLI.

Once you have your storage account navigate to it and then under settings on the left look for Static Website. Click it.

Click on Enable under the static website heading. Then add the name of the html file. You would normally call it index.html. You can also add an error page if you want to. Once you have entered the information click Save.

Once the save has completed you will see your new web address.

Take a note of the web address you will need it for later.

Upload The Site.

Once you clicked save a new container is created for you in blob storage in your Storage Account. The new container is called $web. It is a system container and is where the website will be stored.

You can upload your index.html file in many ways. I am going to use the Storage Explorer in the Azure portal. You can find the Storage Explorer just above Settings on the left of the Storage Account blade.

Once in here expand Blob Containers and then click on $web. To upload your index.html click on the upload button. In this new blade, click on the blue folder and locate your file. Then click on Upload.

Once the file has uploaded, navigate to the web address you had from earlier.

There you have it. A static webpage hosted in an Azure Storage Account. If you wanted to make the URL nicer. You could create a CNAME record with your DNS hosting provider.

I hope you found this article helpful. If you have any questions please reach out in the usual ways.

Share:
Twitter
LinkedIn
Facebook
Reddit
Whatsapp
Follow by Email
Categories: Azure

Pixel Robots.

I’m Richard Hooper aka Pixel Robots. I started this blog in 2016 for a couple reasons. The first reason was basically just a place for me to store my step by step guides, troubleshooting guides and just plain ideas about being a sysadmin. The second reason was to share what I have learned and found out with other people like me. Hopefully, you can find something useful on the site.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *