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.

Adam Bertram

Adam Bertram is a 20-year IT veteran, Microsoft MVP, blogger, and trainer. Adam is the founder of the e-learning tech screencast platform TechSnips. Catch up on Adam’s articles at adamtheautomator.com, or follow TechSnips on Twitter at @techsnips_io.

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!

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!

Are you an IT pro? Apply for membership!

Your question was not answered? Ask in the forum!

0
Share
3 Comments
  1. sandeep 9 months ago

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

    Thanks

     

    0

  2. Panzerbjrn 7 months ago

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

    0

  3. momi 5 months ago

    nice article thanks

    0

Leave a reply

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

*

© 4sysops 2006 - 2019

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