Hosting a static website on Azure Blob Storage is easy and scalable—but the default URL like
https://yourstorageaccount.z13.web.core.windows.net isn’t ideal. Luckily, you can use a custom domain with free HTTPS and performance improvements using Cloudflare's free plan.
I recently did this for my own project and here’s how you can do it too—step by step.
🔧 Prerequisites
- A static website already hosted on Azure Blob Storage
- A custom domain (from any registrar)
- A free Cloudflare account – sign up here
🏗️ Step 1: Enable Static Website Hosting in Azure
- Go to your Storage Account in the Azure Portal.
- Click on "Static website" in the sidebar.
- Enable it and set your
index.html as the entry point.
- Copy the Primary endpoint URL.
🌐 Step 2: Add Your Site to Cloudflare
- Log into Cloudflare and click "Add a Site".
- Enter your domain (e.g.
example.com).
- Choose the Free plan.
- Cloudflare will provide you with new nameservers.
🛠️ Step 3: Update Nameservers
Go to your domain registrar (like GoDaddy or Namecheap) and update the nameservers to the ones Cloudflare gave you. This might take a few hours to propagate.
📌 Step 4: Point Your Domain to Azure Blob Storage
- In Cloudflare’s DNS tab, add a CNAME record:
- Name:
www
- Target:
yourstorageaccount.z13.web.core.windows.net
- Proxy status: DNS only
- Optionally, add a redirect rule from root to
www using a Page Rule or Redirect Rule.
🔒 Step 5: Enable HTTPS with Cloudflare SSL
- In Cloudflare, go to SSL/TLS settings.
- Set SSL mode to Full.
- Wait for the certificate to activate.
- Visit
https://www.yourdomain.com to confirm it’s working.
✅ Final Touches
- Enable Auto Minify under the Speed tab.
- Use Page Rules to redirect root domain if needed.
- Monitor site traffic under Analytics.
- Turn on Always Online and caching features.
🎉 That’s It!
You now have a fast, secure site with your own domain, backed by Azure Blob Storage and served through Cloudflare—for free.
Simple, effective, and perfect for MVPs, landing pages, and personal sites.