Usually, when administrators think about deploying websites, visions of IIS, Apache, and other web servers dance in their heads. Not anymore! Using a simple static website in Azure, admins can now get a site up and running with no web at all! Let's look at a simple way of hosting a static website in Azure.

To create and host a static website in Azure, the first thing we need to do is go to the Azure portal and create a new storage account. Click on Storage Accounts on the left-hand side, click on Add at the top, and fill in the form. We'll give it a Name and select the Account kind of StorageV2.

Creating the storage account

Creating the storage account

Scroll down to the bottom, give it a Resource group, and click on Create. Once the deployment has succeeded, we can click on Refresh, and we should see our storage account appear in the list.

Storage account list

Storage account list

Click into that and scroll down very slightly on the settings. We should see Static website (preview) in the list. We'll click on that and then click on Enabled.

Static website menu option

Static website menu option

Now we need to define the index document name and click on Save.

Created static website

Created static website

The last thing we need to do is go up to Storage Explorer, and we should see we've got a $web container already pre-created for us. This is where we need to upload our file.

$web container

$web container

Now we can find our index.html file and click on Upload. Once it's done uploading, you'll see it in the list below.

Uploading the index.html file

Uploading the index.html file

If we now go back to the Static Website section, copy/paste the Primary endpoint URL, and browse to it, we should see our super simple website displaying our index.html file.

Displaying the website

Displaying the website

However, this is just on an Azure-provided windows.net domain name. If we like, we can also create a custom domain name for our website. To do this, we can go to our DNS registrar, add in a CNAME for blog or whatever name you choose, and point this at our hosted website. The process to do this will be different depending on the DNS registrar you have.

Once we've done this, we'll head back over to our storage account, scroll down again in the settings, and find the Custom Domain option. Once we find this, we'll need to enter the custom domain we just created and then click on Save.

Custom domain

Custom domain

At this point, we can then open up a browser again, enter our new URL, and we should now see the contents of our index.html file showing up!

Subscribe to 4sysops newsletter!

Static websites in Azure are a convenient way of displaying one or more web pages quickly and easily. There's no need for a web server or even a website for that matter! The only thing you need is an Azure storage account and one or more HTML files!

3 Comments
  1. sandeep 4 years ago

    I have some exposure to Azure. Will give it a try. Nice info.

    Thanks

     

  2. Panzerbjrn (Rank 2) 4 years ago

    Thanks. Although I think I’ll do it in PowerShell instead 😉

  3. momi 4 years ago

    nice article thanks

Leave a reply

Your email address will not be published.

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account