A static site serves HTML, CSS, and JavaScript files directly to a browser instead of generating pages for each request with a runtime such as Node.js, ASP.NET, or Java. It suits a simple website that changes infrequently and needs no dynamic content. Azure Storage can host one without a traditional web server to manage. section 9.2
A small business website
Banning Books needs a low-maintenance site for customers, not dynamically generated pages. Its ready-made website files—or your own—can be uploaded to an Azure Storage account. The catch is important: Azure Storage static website hosting serves static content only. section 9.2 section 9.2.3
To publish the files in Azure Storage:
- Put the site’s HTML, CSS, and JavaScript files in the storage account’s $web container. Enabling static website hosting creates $web if it does not already exist, but the files still need to go there. AzCopy can upload them; authenticate its commands with a Shared Access Signature (SAS) token or Entra ID. section 9.2.1 section 9.2.3
- Enable the static website feature and specify an index document and a 404 error document, such as index.html and error.html. Check that the feature is enabled in the Azure portal, then test the website endpoint. section 9.2.3
C:/> az storage blob service-properties update --account-name banningstorage --static-website --404-document error.html --index-document index.html
This Azure CLI command enables static website hosting on a storage account and names its home and error pages. Replace the account name and filenames to match your site. section 9.2.3
The default Azure-provided URL may be awkward to share. For a custom domain, acquire a domain, add a CNAME record for a subdomain such as www, connect that domain in the storage account’s Custom Domain settings, and test it. Do not treat a browser warning as a production security plan: secure site traffic with an SSL certificate or a service such as Azure CDN. section 9.2.4

