Understanding Azure Front Door (Features, Architecture and Uses)
Azure Front Door is a global, application-layer (Layer 7) load balancing and content delivery service that routes user traffic to the closest and healthiest backend across Microsoft's global network.
Key Features
- Global load balancing across multiple regions and backends
- SSL offloading to reduce processing load on backend servers
- Web Application Firewall (WAF) integration for security at the edge
- URL-based routing to send different paths to different backend services
- Caching of static content at edge locations for faster delivery
Architecture Overview
Front Door sits at the edge of Microsoft's global network. User requests hit the nearest Front Door point-of-presence first, which then routes the request to the best-performing healthy backend — whether that backend is in Azure, another cloud, or on-premises.
Common Use Cases
- Running a multi-region web application with automatic failover
- Protecting APIs and websites with a built-in WAF at the network edge
- Speeding up global content delivery with edge caching
- Splitting traffic across microservices using path-based routing
Ready to master Microsoft Azure?
Join Microsoft Azure Training Course at Uncodemy and learn with hands-on projects and mentor support.
How a Request Travels Through Front Door
A Front Door profile is built from a few building blocks, and knowing them makes the portal and the CLI much easier to read.
- Endpoint: the public hostname clients call, such as a generated
*.azurefd.netname or your own custom domain. - Route: a rule that matches a domain plus a path pattern (for example
/api/*) and decides which origin group serves it. - Origin group: a pool of backends that can serve the same content, together with health probe and load-balancing settings.
- Origin: one actual backend, such as an App Service, a storage static website, a VM or a server outside Azure.
- Rule set and security policy: optional layers that rewrite headers, redirect URLs, apply caching rules or attach a WAF policy.
When a browser connects, TLS is terminated at the edge location. Front Door checks the WAF policy, matches a route, serves a cached copy if one is allowed and still fresh, and otherwise forwards the call to the origin that health probes report as healthy. Among healthy origins, priority decides first, and then weight and measured latency spread the load.
Worked Example: Two Regions Behind One Hostname
Suppose the same web app runs in Central India and in Southeast Asia. The commands below create a profile, an endpoint, one origin group with both apps, and a catch-all route.
az afd profile create --resource-group rg-web --profile-name fd-shop --sku Standard_AzureFrontDoor
az afd endpoint create --resource-group rg-web --profile-name fd-shop --endpoint-name shop --enabled-state Enabled
az afd origin-group create --resource-group rg-web --profile-name fd-shop --origin-group-name web-pool --probe-request-type GET --probe-protocol Https --probe-path /health --probe-interval-in-seconds 60 --sample-size 4 --successful-samples-required 3 --additional-latency-in-milliseconds 50
az afd origin create --resource-group rg-web --profile-name fd-shop --origin-group-name web-pool --origin-name india --host-name shop-in.azurewebsites.net --origin-host-header shop-in.azurewebsites.net --priority 1 --weight 1000 --enabled-state Enabled --http-port 80 --https-port 443
az afd origin create --resource-group rg-web --profile-name fd-shop --origin-group-name web-pool --origin-name sea --host-name shop-sea.azurewebsites.net --origin-host-header shop-sea.azurewebsites.net --priority 1 --weight 1000 --enabled-state Enabled --http-port 80 --https-port 443
az afd route create --resource-group rg-web --profile-name fd-shop --endpoint-name shop --route-name all --origin-group web-pool --supported-protocols Http Https --https-redirect Enabled --forwarding-protocol HttpsOnly --link-to-default-domain Enabled --patterns-to-match "/*"
Because both origins share priority 1, users are sent to whichever healthy region answers faster. If you set the second origin to priority 2, it becomes a standby that only receives traffic when the first fails its probes.
Choosing Between Front Door and Its Neighbours
| Service | Works at | Pick it when |
|---|---|---|
| Front Door | Global, HTTP/HTTPS | You need edge TLS, caching, WAF and path routing across regions |
| Traffic Manager | Global, DNS | You only need DNS-based failover, including for non-HTTP traffic |
| Application Gateway | Regional, HTTP/HTTPS | Layer 7 routing and WAF inside a single region or virtual network |
| Load Balancer | Regional, TCP/UDP | Fast, protocol-agnostic distribution between VMs |
Front Door and Application Gateway are often combined: Front Door handles the global entry point while each region keeps its own gateway in front of private workloads.
Mistakes to Avoid When Going Live
- Leaving origins open to the internet. Restrict inbound traffic to the
AzureFrontDoor.Backendservice tag and check theX-Azure-FDIDheader so only your own profile can reach the app. - Caching personalised pages. Turn caching on only for static paths, or respect
Cache-Controlheaders sent by the app. - Heavy health probes. Point probes at a lightweight endpoint; a probe that hits the database on every call adds needless load.
- Wrong origin host header. App Service and many other platforms reject requests whose host header they do not recognise.
- Forgetting to purge. After a deployment, purge cached paths so users do not keep seeing old files.
A quick go-live check: custom domain validated, HTTPS redirect on, WAF in prevention mode after testing in detection mode, origins locked down, and failover tested by stopping one region.