Azure Storage accounts can host static websites by opening up a public endpoint to an Azure storage container ($web), so anything inside of $web will be accessible publicly.
This can be enabled easily by toggling the Static website to Enabled.
Once enabled, the Azure storage account will add a NEW endpoint - <storageaccname>.z*.web.core.windows.net.
Once you have enabled the static website functionality, a new container named: $web will be created; this is the root of your static website – and where your HTML or static website will go.
After you upload your website files to the $web folder.
Add the index document name (i.e., index.html) and click Save.
If done correctly, your website should now show your website.
If done incorrectly, you may get: The requested content does not exist.
If this occurs, make sure:
- There is no whitespace in the index document name.
- The Case matters, make sure if the filename is all lowercase in the container, then it’s all lowercase in the Azure storage account static website configuration.
- Define a 404 page (the page that gets loaded) when attempting to browse paths that don’t match the index - make sure the site exists in a container and is added to the site storage account configuration, like the index document name.
- If you don’t have a 404 page, you can have index.html as both.
- If you have a CDN (Content Delivery Network) in front of your Azure Storage account (Azure CDN, Cloudflare), you may need to adjust the access level of your Container from Private to: Blob (Anonymous). You shouldn’t have to adjust this usually, as the Access level controls the container endpoint access – not the static website endpoint.