Last updated: May 2026
Azure Storage Beginner AZ-104 ⏱ 10 min read

Static Website Hosting on Azure Blob Storage

Azure Blob Storage can serve a complete static website directly — HTML, CSS, JavaScript, images — with no web server required. It's one of the cheapest and simplest ways to host a website, costing fractions of a rupee per GB per month. This is exactly how many modern frontend frameworks (React, Vue, Angular) are deployed at scale.

What you'll learn Enabling static website hosting · The special $web container · Deploying website files · The static website endpoint · Custom error pages · Limitations of blob static hosting · Combining with Azure CDN for custom domains and HTTPS · Azure Static Web Apps vs Blob hosting

What is Static Website Hosting?

A static website consists of files that are served exactly as-is — HTML, CSS, JavaScript, images. There's no server-side processing, no database queries, no backend logic executed on the server. The browser downloads the files and runs everything client-side.

Modern frontend frameworks like React and Vue produce static builds — a folder of HTML, JS, and CSS files that can be served from any web server or object storage service like Azure Blob Storage.

Enabling Static Website Hosting

Via Azure Portal

  1. Go to your Storage Account
  2. In the left menu → Data managementStatic website
  3. Toggle to Enabled
  4. Set Index document nameindex.html
  5. Set Error document path404.html (optional)
  6. Click Save
  7. Azure creates the $web container and shows you the endpoint URL

Via Azure CLI

Azure CLI Enable static website hosting
az storage blob service-properties update \
  --account-name mystorageaccount2026 \
  --static-website \
  --index-document index.html \
  --404-document 404.html \
  --auth-mode login

The $web Container

When you enable static website hosting, Azure automatically creates a special container named $web. All website files must be uploaded to this container. The container is publicly readable — any file in $web can be accessed via the static website endpoint.

ℹ️
$web vs Regular Containers Files in $web are served with proper MIME types and HTTP headers by the static website engine. Regular blob containers don't have this — if you put an HTML file in a regular public container, it downloads instead of rendering.

Deploying Your Website

Azure CLI Deploy a React/Vue/Angular build to Azure Storage
# Build your frontend app first
# npm run build  (creates a /dist or /build folder)

# Upload all files to $web container
az storage blob upload-batch \
  --account-name mystorageaccount2026 \
  --destination '$web' \
  --source ./dist \
  --auth-mode login

# Set correct content types (important for JS/CSS)
# Azure CLI usually handles this automatically

# Delete old files not in the new build (clean deploy)
az storage blob upload-batch \
  --account-name mystorageaccount2026 \
  --destination '$web' \
  --source ./dist \
  --overwrite \
  --auth-mode login

The Static Website Endpoint

After enabling, your website is accessible at a URL like:

Format Static website endpoint
https://[accountname].z[N].web.core.windows.net

# Example:
https://mystorageaccount2026.z13.web.core.windows.net

Note: The zone number (z13, z30, etc.) depends on your region. This is different from the blob storage endpoint.

Custom Error Pages

Set a custom 404 page to handle requests for files that don't exist. This is particularly important for single-page applications (SPAs) where the router handles navigation — all routes should serve index.html.

💡
SPA Routing Trick For React Router, Vue Router, etc.: set both the index document AND the 404 document to index.html. This ensures all routes (like /about, /products/123) serve the app, and the JS router handles the navigation client-side.

Limitations

Blob static hosting has some important limitations:

  • No custom domain with HTTPS out of the box — The default endpoint uses Azure's domain. Custom domain requires Azure CDN.
  • No server-side logic — Only static files. No PHP, Node.js, Python. Use Azure Functions for APIs.
  • No HTTP headers customisation — Can't add custom Cache-Control, CORS headers, etc. without CDN.
  • No HTTP to HTTPS redirect — Requires CDN to enforce HTTPS.
  • Single region — The storage account is in one region. Use CDN to add global distribution.

Adding CDN for Custom Domain + HTTPS

To use a custom domain (like www.yoursite.com) with HTTPS, you add Azure CDN in front of your static website:

  1. Create an Azure CDN profile and endpoint pointing to your static website origin
  2. Add your custom domain to the CDN endpoint
  3. Enable HTTPS (free managed certificate from CDN)
  4. Update your DNS to point to the CDN endpoint

See the Azure CDN with Storage page for the full setup guide.

Blob Hosting vs Azure Static Web Apps

FeatureBlob Static HostingAzure Static Web Apps
SetupManualGitHub/DevOps integrated CI/CD
Custom domain + HTTPSRequires CDNBuilt-in (free SSL)
API integrationSeparate Azure FunctionsBuilt-in managed Functions
Staging environmentsSeparate storage accountsBuilt-in preview environments per PR
Auth integrationManualBuilt-in (GitHub, Azure AD, etc.)
Cost~₹0.10–1/month (storage only)Free tier available; paid from ~₹700/month
Best forSimple sites, full manual controlModern web apps with CI/CD and APIs
💡
This site uses Azure Static Web Apps RedKiteCloud.com is hosted on Azure Static Web Apps — which builds and deploys automatically from GitHub on every push. For a new project, Azure Static Web Apps is the recommended approach. Blob static hosting is useful when you need maximum control or are integrating into an existing pipeline.
📝 Practice Questions
Click an option to check your answer. AZ-104 style questions.
Q1. What special container is automatically created when static website hosting is enabled on a storage account?
A $static
B $web
C $public
D website
Q2. What additional Azure service is required to use a custom domain with HTTPS on a Blob-hosted static website?
A Azure App Service
B Azure CDN
C Azure DNS only
D Azure Load Balancer
Q3. A developer is hosting a React single-page application on Azure Blob Storage. Users get 404 errors when navigating directly to routes like /about. What is the fix?
A Create a separate HTML file for each route in the $web container
B Set both the index document and the 404 error document to index.html
C Disable static website hosting and use a regular blob container
D Add a server-side proxy to handle route redirects
Q4. What is the main advantage of Azure Static Web Apps over Blob-hosted static websites?
A Azure Static Web Apps is cheaper for simple storage
B Built-in CI/CD, HTTPS, authentication, and API integration without manual configuration
C Supports server-side rendering for all frameworks
D Significantly faster page load times for static content
Q5. Can server-side code (like Node.js or PHP) be executed on Azure Blob static website hosting?
A Yes — Node.js is supported natively
B Yes — but only with the Premium storage tier
C No — Blob static hosting is files-only. Use Azure Functions for backend logic.
D Yes — Python is supported via Azure Functions integration
Comments
Disclaimer: RedKite Cloud is an independent educational resource and is not affiliated with Microsoft Corporation.