Azure Front Door Guide: Global Acceleration & WAF
What Is Azure Front Door
Azure Front Door is Microsoft's cloud CDN plus load balancer, delivering content over the Microsoft global network (118+ edge sites across 100+ metro areas). It accelerates both static and dynamic content and often serves as a global application entry point: it provides CDN caching as well as cross-region routing, health checks, and SSL offload. Compared with a plain CDN, it behaves more like an application-layer gateway, well suited to dynamic content acceleration scenarios.
Key Features
- Anycast + Split TCP: connection establishment is optimized to the nearest edge, improving latency by up to three times.
- Edge SSL offload: HTTPS terminates at the edge with automatically rotated managed certificates, reducing certificate management overhead.
- Intelligent routing and health probes: traffic is routed to healthy origins based on their status for high availability.
- Unified static and dynamic delivery: one tier provides caching, SSL offload, and L3-L4 DDoS protection.
Standard vs Premium
| Capability | Standard | Premium |
|---|---|---|
| Global Anycast acceleration | ✔ | ✔ |
| Rules Engine / caching | ✔ | ✔ |
| Managed WAF rules | Basic | Full (incl. bot protection) |
| Private Link origins | ✘ | ✔ |
| Azure security posture integration | Basic | Full |
Most global sites are fine with Standard; move to Premium only if you need to hide origins inside a virtual network (Private Link) or want fuller bot protection.
Step 1: Create a Front Door
In the Azure portal, create a Front Door resource and choose Standard or Premium:
- Create a Front Door profile with a resource group and region.
- Create an Endpoint; it maps to a user-facing global domain.
- Add an Origin Group: add backends such as App Service, Storage, or VMs, and set the health probe interval and protocol so Front Door automatically removes unhealthy origins.
The same creation works from the Azure CLI (creating a profile here):
az afd profile create \
--resource-group my-rg \
--profile-name my-frontdoor \
--sku Standard_AzureFrontDoor
CLI configuration fits naturally into IaC scripts and version control, avoiding manual mis-clicks in the portal.
Step 2: Configure Routes
Create a Route mapping a request path (such as /api/* or /*) to an origin group, and configure:
- Protocol: HTTP/HTTPS; force HTTPS redirects for security.
- Caching rules: set cache TTL for static content, or bypass caching for dynamic requests.
- Rules Engine: rewrite paths, inject headers, or rewrite URLs at the edge using regex and server variables.
For multi-region origins, use cross-region failover, and pair it with multi-CDN load balancing for higher-level redundancy.
A Real Scenario: Global Acceleration for Cross-Border E-Commerce
An independent store serving North America and Southeast Asia kept its origin in Singapore. North American users connected directly to the origin, with first-paint TTFB averaging 600-900ms, and cross-ocean links dropped packets during promotions. After moving behind Front Door, static assets were cached at the edge, and dynamic APIs connected via Anycast to the nearest edge before going to the origin — North American first paint dropped to around 200ms. Just as importantly, health probes routed traffic around a failing origin: during one Singapore datacenter maintenance window, traffic silently shifted to a standby origin in Hong Kong with zero user-visible impact. For this kind of "global users + one or few origins" architecture, Front Door's acceleration and failover value is direct.
Step 3: Attach a Custom Domain and Certificate
- Add a custom domain such as
www.example.comin Front Door and complete domain ownership validation. - Use managed certificates: Azure creates and rotates them automatically, or upload your own.
- Add a CNAME record pointing to the Front Door endpoint domain.
For certificate types and procurement, see SSL certificate guide 2026.
Step 4: Attach a WAF Policy
Azure Front Door attaches seamlessly to a Web Application Firewall (WAF):
- Built-in managed rule sets: SQL injection, XSS, malicious bots, and more out of the box.
- Custom rules: allow or block by IP, geography, or request header.
- Combine with Azure DDoS Protection for full L3-L7 defense; see CDN security protection features.
A WAF policy runs in two modes: detection mode only logs matches without blocking, while prevention mode actively blocks. Right after launch, run detection mode for about a week to confirm the rules don't break legitimate traffic (for example, mistakenly blocking valid mobile requests), then switch to prevention. The two most common custom rules are "rate-limit by IP" and "block traffic from specific countries or regions."
Pricing and When to Choose It
Front Door bills by endpoints, forwarding rules, data transfer, and requests, with no upfront commitment. It fits global multi-region apps, hybrid static/dynamic acceleration, and edge WAF with DDoS protection. If your business lives in the Azure ecosystem and you want routing and security delivered together, it beats a plain CDN. For a comparison, see our CDN provider selection guide.
- Can Front Door replace the origin's CDN? It can, but remember it is positioned as an application-layer gateway — for image-heavy sites with massive static assets, a classic CDN is usually cheaper and simpler.
- What if route priorities conflict? Front Door matches routes by longest prefix. Put more specific paths (like
/api/*) first so they aren't swallowed by a catch-all route. - How often should health probes run? 30-60 seconds is typical; more frequent probes add origin load, while rarer probes slow down failover.
16IDC Take
Front Door's value is combining "CDN + load balancer + WAF" in one: one configuration handles acceleration, failover, and security, ideal for global SaaS and cross-border e-commerce. The trade-offs are more billing meters and a steeper learning curve than a pure CDN. For small sites that only need image/static acceleration, a classic CDN is more cost-effective. More content in the CDN acceleration category.
Source: https://learn.microsoft.com/en-us/azure/frontdoor/front-door-overview
Reference: Azure Front Door documentation https://learn.microsoft.com/en-us/azure/frontdoor/
Reference: Azure CLI afd reference https://learn.microsoft.com/en-us/cli/azure/afd
Integration & Code Examples
Example 1: Create a Front Door profile, endpoint, and origin group with the CLI
# 1) Create a Standard-tier Front Door profile
az afd profile create -g "$RG" --profile-name my-afd \
--sku Standard_AzureFrontDoor
# 2) Create an endpoint, the global hostname users hit
az afd endpoint create -g "$RG" --profile-name my-afd \
--endpoint-name web --enabled-state Enabled
# 3) Create an origin group and define the health probe
az afd origin-group create -g "$RG" --profile-name my-afd \
--origin-group-name primary \
--probe-request-type HEAD --probe-protocol Https \
--probe-interval-in-seconds 30 --probe-path /
Configure probes first, otherwise Front Door cannot evict an unhealthy origin.
Example 2: Attach an origin and wire up a route
# 4) Add the origin: priority sets active/standby, weight splits traffic
az afd origin create -g "$RG" --profile-name my-afd \
--origin-group-name primary --origin-name app-east \
--host-name app-east.example.com \
--origin-host-header app-east.example.com \
--http-port 80 --https-port 443 \
--priority 1 --weight 1000 --enabled-state Enabled
# 5) Map a path pattern to the origin group and enable caching
az afd route create -g "$RG" --profile-name my-afd \
--endpoint-name web --route-name default \
--origin-group primary --supported-protocols Https \
--patterns-to-match "/*" --forwarding-protocol MatchRequest \
--link-to-default-domain Enabled --enable-caching true
# 6) Confirm the route took effect
az afd route list -g "$RG" --profile-name my-afd --endpoint-name web \
--query '[].{Name:name,Patterns:patternsToMatch,Caching:cacheConfiguration}'
A route maps a path pattern to an origin group, which is where canary splitting lives.
Path Prefix, Probe Interval and Origin Priority Values
Inside one configuration, path matching, probing and origin parameters each own one job. Fixing each value in a table tells you which field to open when something breaks.
| Setting | Value | Rationale |
|---|---|---|
| Path match | Longest prefix wins; give /api/* its own route |
A more specific path needs its own route to carry separate cache and forwarding rules |
| Health probe interval | 30–60 seconds | 30 for tight failover, 60 when origins are weak |
| Probe request | --probe-request-type HEAD, --probe-protocol Https |
Probing over the same protocol as live traffic keeps the result meaningful |
| Origin priority | Primary --priority 1, backups higher |
A failed probe switches by priority |
| Origin weight | Start at --weight 1000, split by ratio |
Decides the share among equal-priority origins |
| Cache | TTL on for static assets, off for APIs | Dynamic requests go straight to origin |
| WAF mode | Detection first, protection after a week of observation | Detection logs matches without blocking |
Path and cache are decided together: /api/* with caching off and /* with caching on, each route carrying its own rules, checks out more easily than one route stuffed with exceptions.
Priority and weight are two separate mechanisms. --priority sets the primary/backup order, lower numbers first; --weight only splits traffic within one priority tier, starting from 1000 in the sample.
Two Weeks From Detection Mode to Protection Mode
Week one runs detection: the WAF matches managed and custom rules but only logs hits. Sort those hits by rule ID and request path, and look first at whether mobile or API requests were caught by mistake.
Start the custom rules with just two: per-IP request rate limiting, and blocking traffic from named countries or regions. Both have crisp criteria and a narrow blast radius; leave complex regex rules for week two.
Week two flips the rules that showed no anomalies into protection mode, one group at a time with a day of observation between groups. When the WAF policy sits alongside DDoS Protection, log the two separately — otherwise it is unclear whether an edge rule or origin protection blocked the request.
Limitations
- Configure probes first, otherwise Front Door cannot evict an unhealthy origin.
- This article reflects public information as of 2026-08-06; terms, prices and quotas follow the provider's current published terms.
- Third-party capability and limit statements follow their official documentation; no further commitment is implied here.
- Licensing, filing and data-residency decisions must be verified against the regulations of your operating region.
FAQ
Is Premium required to keep origins in a VNet?
Yes — Private Link origins are Premium-only, and Standard has no equivalent. Pick Premium when origins sit inside a virtual network and must not expose public IPs; it also brings the full WAF managed rule set and bot protection. Origins that are public App Service or Storage endpoints work fine on Standard.
What items make up Front Door billing?
Use 4 billing items: endpoints, forwarding rules, traffic, and requests, billed on demand with no upfront commitment. Requests and traffic count separately — a cache hit still counts as a request but moves no origin traffic, and rules engine or WAF policies add request processing. Budget in three lines: endpoint fee, monthly requests, origin traffic.
Should health probes run every 30 or 60 seconds?
Use 30–60 seconds; both work, so pick by what the origin can absorb. Probes that are too frequent add load, while sparse probes slow failover, so 30 seconds suits sites needing fast recovery and 60 seconds suits weaker origins. Point probes at a dedicated health page, not the homepage, or a content change can mark a healthy origin as down.
When should you avoid upgrading to Premium?
Use Standard when every origin is public and you only need caching. Standard already includes global Anycast, the rules engine, and basic WAF managed rules, so Private Link and bot protection are the real Premium increments; for image-heavy sites a traditional CDN is cheaper and simpler to configure.
Related Providers
- Azure CDN: Use it when an Azure origin needs a plain CDN billing baseline to compare against.
- Cloudflare: Use it when cross-region routing and WAF rules must be edited in one console.
- AWS CloudFront: Use it when checking per-GB pricing and edge coverage for a multi-cloud entry.
Community & Resources
Official docs and communities
- Front Door overview — Anycast, Split TCP, and routing mechanics.
- WAF policies — Managed rules, custom rules, and bot protection.
- az afd reference — Parameters for profile, endpoint, origin, and route.
- Quickstart: create a Front Door — From zero to a reachable hostname.
Learning resources and tools
- Azure CLI repository — Implementation and sample scripts.
- Routing architecture — How requests match endpoints, routes, and origins.
- Stack Overflow: azure-front-door — Debugging probe failures and cache misses.
Original source: Microsoft Learn ↗