🚀 Use Cloudflare Free Tier to Add a Custom Domain to Azure Blob Storage

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

🏗️ Step 1: Enable Static Website Hosting in Azure

  1. Go to your Storage Account in the Azure Portal.
  2. Click on "Static website" in the sidebar.
  3. Enable it and set your index.html as the entry point.
  4. Copy the Primary endpoint URL.

🌐 Step 2: Add Your Site to Cloudflare

  1. Log into Cloudflare and click "Add a Site".
  2. Enter your domain (e.g. example.com).
  3. Choose the Free plan.
  4. 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

  1. In Cloudflare’s DNS tab, add a CNAME record:
    • Name: www
    • Target: yourstorageaccount.z13.web.core.windows.net
    • Proxy status: DNS only
  2. Optionally, add a redirect rule from root to www using a Page Rule or Redirect Rule.

🔒 Step 5: Enable HTTPS with Cloudflare SSL

  1. In Cloudflare, go to SSL/TLS settings.
  2. Set SSL mode to Full.
  3. Wait for the certificate to activate.
  4. Visit https://www.yourdomain.com to confirm it’s working.

✅ Final Touches

🎉 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.