Host a static website in azure blob storage with a custom domain
If you want to host a static website in Azure, you only need a storage account to do that. So go to Azure Portal and create a new storage account
Navigate to the newly created storage account, select “Static website” in the navigation on the left hand side, and then enable “Static website”. You can also configure the filename of the index document and the 404 page.
After saving the changes, Azure will create a new container with the name “$web” in your storage account and also shows the endpoint on how to access the website.
If you open the link in the browser, you get a 404 error because we have not uploaded anything to the storage account yet. Let’s upload your site or just a sample index.html file to the $web container and try again.
So far so good, but the address https://fancysite.z6.web.core.windows.net is not so nice. Let’s add a custom domain. Even though there is a menu item “Custom domain” on the storage account, this doesn’t support https, therefore we have to use Azure CDN.
Ensure that the “Origin hostname” points to the static website.
Finally we need to create a new dns record, more precisely a CNAME record that points to the “CDN enpoint name” that you configured in the previous step. Log in to your domain registrar and adjust the dns settings for your domain. I use directnic.com - and this is the configuration
It may take a few minutes until the CDN is up and running, but then your static website is available with your custom domain over https.