Back to Labs & Blog
Networking Security Architecture May 2025 8 min read

Azure Front Door: Global Load Balancing & WAF in One Service

Azure Front Door is one of those services that does more than its name suggests. It's not just a load balancer — it's a global CDN, a SSL terminator, a WAF, a DDoS layer, and a traffic router all in one. Here's how it works, why you'd choose it, and how to architect it correctly.

Rajaas Tahir
Rajaas Tahir
Cloud & AI Solution Architect · 26x Certified
Watch on YouTube

What Is Azure Front Door?

Azure Front Door (AFD) is Microsoft's global HTTP/HTTPS load balancer and CDN, operating at Layer 7 of the network stack. Unlike a classic load balancer that routes traffic within a single region, Front Door routes traffic across regions based on latency, health, and routing rules — all from Microsoft's global edge network (200+ PoPs).

The key insight: Front Door doesn't run in a single Azure region. It runs on Microsoft's global edge — the same backbone that powers Azure CDN, Teams, and Office 365. Your traffic is accelerated globally before it ever reaches your origin servers.

Architecture Insight

Front Door terminates TLS at the edge — closest to your users. This reduces round-trip latency significantly, especially for users far from your origin region. It's a meaningful performance win you don't get from a regional load balancer.

Architecture Overview

Here's how a typical Front Door architecture looks for a multi-region Azure application:

// Azure Front Door — Traffic Flow
User (Toronto) ──────► AFD Edge PoP (Toronto) // TLS terminated here
WAF Policy // OWASP rules, custom rules, rate limits
Routing Rules // path-based, header-based routing
───────┴──────────
│ │
Origin: East US Origin: West Europe // failover
App Service / AKS App Service / AKS

Standard vs. Premium Tier — The Trade-off

Front Door has two tiers (as of the Standard/Premium rebranding). This is a real architectural decision with cost implications:

Standard Tier (~$35/month base + traffic)

Premium Tier (~$330/month base + traffic)

Cost Trade-off

The jump from Standard to Premium is significant in base cost. Only go Premium if you need Private Link origins or advanced bot protection. I've seen teams over-pay by defaulting to Premium without evaluating the requirements.

WAF Configuration — What Actually Matters

The Web Application Firewall in Front Door gives you two layers of defense:

1. Managed Rule Sets (DRS 2.0)

Microsoft's Default Rule Set covers OWASP Top 10 — SQL injection, XSS, path traversal, and more. Enable this on every WAF policy. The question is whether to run in Detection or Prevention mode.

2. Custom Rules

Custom rules let you block/allow based on IP ranges, geo-location, request headers, and rate limits. Common patterns I implement:

# Example: Bicep snippet for AFD WAF Policy with custom rate limit rule
resource wafPolicy 'Microsoft.Network/FrontDoorWebApplicationFirewallPolicies@2022-05-01' = {
  name: 'wafPolicyProd'
  location: 'global'
  sku: { name: 'Standard_AzureFrontDoor' }
  properties: {
    policySettings: {
      mode: 'Prevention'
      enabledState: 'Enabled'
    }
    managedRules: {
      managedRuleSets: [
        { ruleSetType: 'Microsoft_DefaultRuleSet', ruleSetVersion: '2.1' }
        { ruleSetType: 'Microsoft_BotManagerRuleSet', ruleSetVersion: '1.0' }
      ]
    }
    customRules: {
      rules: [
        {
          name: 'RateLimitLogin'
          priority: 100
          ruleType: 'RateLimitRule'
          rateLimitThreshold: 100
          rateLimitDurationInMinutes: 1
          action: 'Block'
          matchConditions: [
            {
              matchVariable: 'RequestUri'
              operator: 'Contains'
              matchValue: ['/auth/login']
            }
          ]
        }
      ]
    }
  }
}

Securing Origins — No Public IP Exposure

A common mistake is deploying Front Door but leaving origin App Services or AKS clusters publicly accessible. This bypasses WAF entirely. Two approaches to lock this down:

Standard Tier: IP Restriction + AFD Service Tag

In App Service, restrict inbound traffic to the AzureFrontDoor.Backend service tag. This allows only AFD egress IPs. Also validate the X-Azure-FDID header in your app to ensure requests are from your specific Front Door instance (not someone else's AFD pointing at you).

Premium Tier: Private Link (Zero Public IP)

With Premium, you can configure AFD to route to App Services, Internal Load Balancers, or Storage via Private Link. Origins have no public IP. This is the gold standard for security-critical workloads.

Security Win

Always validate the X-Azure-FDID header even with Standard tier. It takes 5 minutes to implement and prevents someone else's Front Door from bypassing your WAF to hit your origin directly.

Routing Patterns

Front Door supports powerful routing rules. The ones I use most in production:

Caching — Reduce Origin Load

Front Door can cache responses at edge PoPs, dramatically reducing load on your origins. Key configuration decisions:

Monitoring & Observability

Connect Front Door to Log Analytics and set up these essential queries:

// WAF blocked requests — top offenders
AzureDiagnostics
| where ResourceType == "FRONTDOORS" and Category == "FrontdoorWebApplicationFirewallLog"
| where action_s == "Block"
| summarize Count = count() by clientIp_s, ruleName_s
| top 20 by Count desc

// Origin health — detect when an origin goes unhealthy
AzureDiagnostics
| where ResourceType == "FRONTDOORS" and Category == "FrontdoorHealthProbeLog"
| where httpStatusCode_d != 200
| summarize FailCount = count() by originName_s, bin(TimeGenerated, 5m)
| order by TimeGenerated desc

When to Use Front Door vs. Application Gateway

This is one of the most common questions I get:

Key Takeaway

Front Door is a global service, Application Gateway is regional. They solve different problems and can complement each other. Don't use Application Gateway as a substitute for AFD if you have international users — the latency difference is real and measurable.

Summary

Azure Front Door is one of the highest-leverage services in Azure's networking portfolio. When architected correctly, it gives you:

The main architectural decisions: Standard vs. Premium tier, WAF mode (Detection → Prevention), and how you secure your origins. Get those right and you have a robust, globally distributed application entry point.

Rajaas Tahir
Rajaas Tahir
Cloud & AI Solution Architect · 26x Certified · Toronto, Canada

I write about cloud architecture, Azure, DevOps, and AI infrastructure — the real decisions and trade-offs, not just tutorials. Follow along on YouTube and GitHub for hands-on labs.

Subscribe on YouTube Connect on LinkedIn GitHub Labs