
close
close
There are many ways to host websites in Azure. The newest of these is to store static website code in a special container in a General Purpose v2 (GPv2) storage account. The benefit of this is that you get an ultra-simple configuration and an ultra-low cost. The website code must be static, but backend process execution can be done with Azure platform features such as Functions. If you need dynamic content, then Microsoft recommends you stick with Azure App Services or, if you really need to, virtual machines.
At the most basic level, the cost of hosting will be:
advertisment
Additional costs might be accrued if you add extra features such as Content Delivery Network (CDN), Functions, and so on.
The infrastructure you require for this hosting is a GPv2 storage account – GPv1 is not supported.
Creating an Azure GPv2 storage account [Image Credit: Aidan Finn]
After the save commits, the URL of the website will appear – document this.
Enabling static website hosting in an Azure storage account [Image Credit: Aidan Finn]
Now you can upload content to the storage account. Once you enable static website hosting, a system container called $web is created in blob storage in the GPv2 storage account. This will be where you store the website. There are many ways to get content into the container:
advertisment
In my case, I am using the Azure Storage Explorer.
Upload content for a static website in an Azure storage account [Image Credit: Aidan Finn]
Browsing the default website URL [Image Credit: Aidan Finn]
The default URL is not quite user-friendly and most people will need a vanity URL, such as http://petri.com. There are a couple of gotchas.
You might have noticed that the storage account provides HTTPS hosting. Currently, we cannot upload a custom SSL certificate to a storage account to be associated with a vanity domain URL. The only workaround is to abstract the storage account using Azure’s CDN, which will have the added benefit of improving the performance of the website.
The second gotcha is that the static website on the storage account does not have a static public IP address. This means that we cannot create a root vanity domain name (petri.com) and users will have to browse to petri.com.
If you want to use SSL/TLS then you have no choice right now but to use the aforementioned CDN solution. However, if you want to enable insecure browsing (no SSL/TLS) then
You can associate a vanity domain by doing the following:
You will probably have to wait a few minutes for the new name to be usable.
advertisment
More from Aidan Finn
advertisment
Petri Newsletters
Whether it’s Security or Cloud Computing, we have the know-how for you. Sign up for our newsletters here.
advertisment
More in Microsoft Azure
Build 2022: Microsoft's Intelligent Data Platform Combines Data and Analytics
May 25, 2022 | Rabia Noureen
Microsoft Revises Restrictive Cloud Licensing Policies to Avoid EU Antitrust Probe
May 19, 2022 | Rabia Noureen
Microsoft's Azure AD Conditional Access Service Can Now Require Reauthentication
May 13, 2022 | Rabia Noureen
Microsoft Addresses Cross-Tenant Database Vulnerability in Azure PostgreSQL
Apr 29, 2022 | Rabia Noureen
Microsoft Simplifies IT Monitoring with New Azure Managed Grafana Service
Apr 19, 2022 | Rabia Noureen
Most popular on petri
Log in to save content to your profile.
Article saved!
Access saved content from your profile page. View Saved
Join The Conversation
Create a free account today to participate in forum conversations, comment on posts and more.
Copyright ©2019 BWW Media Group