Azure Favicon Complete Guide

Master favicon deployment on Microsoft Azure: Blob Storage static hosting, Azure CDN, Static Web Apps, App Service, Front Door, and optimization strategies.

Azure Deployment Options

Blob Storage
Static hosting

Static Web Apps
Modern framework

App Service
Full web hosting

Azure CDN
Global delivery

Azure Blob Storage Static Website

Method 1: Blob Storage Hosting

Step 1: Create Storage Account

  1. Open Azure Portal: portal.azure.com
  2. Create resource ? Storage account
  3. Resource group: Create new or use existing
  4. Storage account name: yourwebsitestorage
  5. Region: Choose closest to users
  6. Performance: Standard (cheaper)
  7. Redundancy: LRS (locally redundant) for cost savings
  8. Review + create ? Create

Step 2: Enable Static Website

  1. Go to your storage account
  2. Data management ? Static website
  3. Enable: Enabled
  4. Index document name: index.html
  5. Error document path: 404.html
  6. Save
  7. Note primary endpoint: https://yourwebsite.z13.web.core.windows.net/

Step 3: Upload Favicon Files

Via Azure Portal:

  1. Storage browser ? Blob containers ? $web
  2. Upload ? Select favicon files
  3. Upload

Via Azure CLI:

# Upload single file
az storage blob upload \
  --account-name yourwebsitestorage \
  --container-name '$web' \
  --name favicon.ico \
  --file favicon.ico \
  --content-type "image/x-icon"

# Upload multiple files
az storage blob upload-batch \
  --account-name yourwebsitestorage \
  --destination '$web' \
  --source ./favicons \
  --pattern "favicon*"

# Set cache control
az storage blob update \
  --account-name yourwebsitestorage \
  --container-name '$web' \
  --name favicon.ico \
  --content-cache-control "public, max-age=31536000"

Step 4: Configure CORS (if needed)

az storage cors add \
  --account-name yourwebsitestorage \
  --services b \
  --methods GET HEAD \
  --origins '*' \
  --allowed-headers '*' \
  --exposed-headers '*' \
  --max-age 3600
Test: Access https://yourwebsite.z13.web.core.windows.net/favicon.ico

Azure CDN Configuration

Add CDN for Global Distribution

Create CDN Profile

  1. Azure Portal ? Create resource ? CDN
  2. Resource group: Same as storage account
  3. Name: yourwebsite-cdn
  4. Pricing tier: Standard Microsoft (good balance)
  5. Create new CDN endpoint:
    • Endpoint name: yourwebsite
    • Origin type: Storage static website
    • Origin hostname: Select your storage account
  6. Create

CDN Endpoint URL

Your site will be available at:
https://yourwebsite.azureedge.net/

Configure Caching Rules

Go to CDN endpoint ? Caching rules:

Global caching rule:

  • Query string caching behavior: Ignore query strings
  • Caching behavior: Override
  • Cache expiration duration: 1 year

Custom caching rule:

  • Name: Favicon Long Cache
  • Match condition: Path ? Contains ? favicon
  • Caching behavior: Override
  • Cache expiration duration: 1 year

Custom Domain & HTTPS

  1. CDN endpoint ? Custom domains ? Add custom domain
  2. Custom hostname: www.yourdomain.com
  3. Add CNAME record in DNS:
    • Name: www
    • Type: CNAME
    • Value: yourwebsite.azureedge.net
  4. Back in Azure ? Validate and add
  5. Enable HTTPS:
    • Custom domain HTTPS: On
    • Certificate management: CDN managed (free)
    • Wait 6-8 hours for certificate provisioning
Free SSL: Azure CDN provides free SSL certificates for custom domains via DigiCert.

Azure Static Web Apps

Method 2: Modern Framework Hosting

Create Static Web App

  1. Azure Portal ? Create resource ? Static Web App
  2. Resource group: Create or select existing
  3. Name: yourwebsite
  4. Plan type: Free (100 GB bandwidth/month)
  5. Deployment source: GitHub
  6. Sign in to GitHub and select repository
  7. Build presets: Select framework (React, Vue, Angular, etc.)
  8. App location: / or your app folder
  9. Output location: build, dist, or framework default
  10. Review + create ? Create

Favicon Configuration

Place favicons in your output folder (usually public or static):

your-app/
  public/            # or static/
    favicon.ico
    favicon-16x16.png
    favicon-32x32.png
    favicon-96x96.png
    favicon-512x512.png
    apple-touch-icon.png
    site.webmanifest

Custom Headers (staticwebapp.config.json)

{
  "routes": [
    {
      "route": "/favicon*",
      "headers": {
        "Cache-Control": "public, max-age=31536000, immutable"
      }
    },
    {
      "route": "/*.ico",
      "headers": {
        "Cache-Control": "public, max-age=31536000"
      }
    }
  ],
  "globalHeaders": {
    "content-security-policy": "default-src 'self'"
  },
  "mimeTypes": {
    ".ico": "image/x-icon",
    ".webmanifest": "application/manifest+json"
  }
}
Benefit: Static Web Apps automatically include global CDN, free SSL, and CI/CD from GitHub.

Azure App Service

Method 3: Full Web Application Hosting

ASP.NET Core / Blazor Setup

Place favicons in wwwroot folder:

YourBlazorApp/
  wwwroot/
    favicon.ico
    favicon-16x16.png
    favicon-32x32.png
    apple-touch-icon.png

web.config for IIS on App Service

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <remove fileExtension=".ico" />
      <mimeMap fileExtension=".ico" mimeType="image/x-icon" />
      <remove fileExtension=".webmanifest" />
      <mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" />
      
      <!-- Cache for 1 year -->
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
    </staticContent>
    
    <rewrite>
      <outboundRules>
        <rule name="Add Cache Header for Favicons">
          <match serverVariable="RESPONSE_Cache-Control" pattern=".*" />
          <conditions>
            <add input="{REQUEST_URI}" pattern="favicon" />
          </conditions>
          <action type="Rewrite" value="public, max-age=31536000" />
        </rule>
      </outboundRules>
    </rewrite>
  </system.webServer>
</configuration>

Deploy via Visual Studio

  1. Right-click project ? Publish
  2. Target: Azure ? Azure App Service (Windows)
  3. Select or create App Service
  4. Publish
  5. Favicons automatically deployed to wwwroot
Note: App Service includes automatic HTTPS, but CDN requires separate configuration.

Cache Purging

Update Cached Favicons

Azure CDN Purge

Via Azure Portal:

  1. Go to CDN endpoint
  2. Purge
  3. Content path: /favicon.ico, /favicon-*.png
  4. Purge
  5. Wait 5-10 minutes for completion

Via Azure CLI:

# Purge specific files
az cdn endpoint purge \
  --resource-group myResourceGroup \
  --name yourwebsite \
  --profile-name yourwebsite-cdn \
  --content-paths '/favicon.ico' '/favicon-16x16.png' '/favicon-32x32.png'

# Purge all favicon files
az cdn endpoint purge \
  --resource-group myResourceGroup \
  --name yourwebsite \
  --profile-name yourwebsite-cdn \
  --content-paths '/favicon*' '/*favicon*'

Azure Front Door Purge

az afd endpoint purge \
  --resource-group myResourceGroup \
  --profile-name myFrontDoor \
  --endpoint-name myEndpoint \
  --content-paths '/favicon.ico' '/favicon-*.png'

Azure Favicon Best Practices

? Recommendations

  • Use Static Web Apps for modern frameworks (free tier generous)
  • Enable Azure CDN for global distribution
  • Set cache control to 1 year for favicons
  • Use Blob Storage for static-only sites (cheapest)
  • Enable free SSL via CDN managed certificates
  • Configure custom caching rules for favicon paths
  • Use Azure CLI for automated deployments
  • Monitor with Application Insights
  • Use LRS redundancy for cost savings

? Common Mistakes

  • Not enabling static website on Blob Storage
  • Missing cache control headers
  • Not purging CDN after favicon update
  • Using GRS redundancy unnecessarily (expensive)
  • Forgetting to configure MIME types
  • Not enabling HTTPS on custom domains
  • Skipping CDN for better performance
  • Incorrect CNAME configuration for CDN
  • Not testing across regions

Azure Pricing Overview

Estimated Monthly Costs

Service Free Tier Paid (Small Site)
Static Web Apps 100 GB bandwidth/month Free for most sites
Blob Storage (LRS) N/A $0.02/GB/month
Azure CDN (Standard) N/A ~$0.081/GB + requests
App Service (B1) N/A ~$13/month
Recommended: Azure Static Web Apps Free tier is best for most favicon setups. Typical cost: $0-5/month.

Generate Azure-Ready Favicons

Create favicon packages optimized for Microsoft Azure deployment

Generate Favicons

Related Articles

An unhandled error has occurred. Reload 🗙