Load Balancing and Traffic Routing in Azure: Load Balancer, Application Gateway, Front Door and Traffic Manager
Four Services, Two Questions
| Service | Layer | Scope | Best for |
|---|---|---|---|
| Azure Load Balancer | 4 (TCP/UDP) | Regional (also a cross-region tier) | Fast distribution of any TCP/UDP traffic, internal tiers, non-HTTP |
| Application Gateway | 7 (HTTP/HTTPS) | Regional | Web apps: URL path routing, host routing, TLS termination, WAF, cookie affinity |
| Azure Front Door | 7 (HTTP/HTTPS) | Global edge | Global web apps: anycast edge, CDN caching, WAF, fast failover, SSL |
| Traffic Manager | DNS | Global | DNS-based routing to any endpoint (including non-HTTP and on-premises) with health checks |
Decision Flow
text
Is traffic HTTP/HTTPS?
├─ Yes ─ Global users / multi-region? ─ Yes → Azure Front Door (+ WAF)
│ └ No → Application Gateway (+ WAF)
└─ No ─ Global needed? ─ Yes → Traffic Manager (DNS) or cross-region Load Balancer
└ No → Azure Load Balancer (internal or public)
Azure Load Balancer
- Standard SKU (use this): zone-redundant, secure by default, SLA 99.99 percent. Basic is being retired
- Parts: frontend IP, backend pool, health probe, load balancing rules, inbound NAT rules, outbound rules
- Public and internal types. Distribution is a 5-tuple hash by default. Session persistence is optional
bash
az network lb create -g rg-net -n lb-web --sku Standard --vnet-name vnet-app --subnet web --frontend-ip-name fe --backend-pool-name be
az network lb probe create -g rg-net --lb-name lb-web -n http-probe --protocol Http --port 80 --path /health
az network lb rule create -g rg-net --lb-name lb-web -n http-rule --protocol Tcp --frontend-port 80 --backend-port 80 --frontend-ip-name fe --backend-pool-name be --probe-name http-probe
Application Gateway
- Layer 7 reverse proxy with path-based routing (
/api/*to one pool,/images/*to another) and multi-site hosting - TLS termination and end-to-end TLS, redirects, header rewrite, WAF v2 and autoscaling, zone redundancy
- Needs a dedicated subnet. There is also Application Gateway for Containers for AKS
Azure Front Door
- Global entry point over Microsoft's edge network. Users connect to the nearest edge, then traffic uses the backbone
- Routes by path, host and headers, with caching, compression, rules engine, custom domains with managed certificates
- Health probes and instant failover across regions or even clouds
- Use WAF and Private Link origins (Premium) to keep origins private
text
Users ─► Front Door (WAF, TLS, CDN) ─┬─► Origin group (Central India App Gateway)
└─► Origin group (West Europe App Gateway) (priority or latency based)
Traffic Manager
| Routing method | Idea |
|---|---|
| Priority | Primary with failover to backup |
| Weighted | Split by percent (migrations, blue/green) |
| Performance | Lowest latency endpoint |
| Geographic | Region by user location (compliance) |
| Multivalue / Subnet | Return several IPs, or map client ranges |
- Works at the DNS level only, so traffic does not flow through it and failover depends on DNS TTL
- Works with any internet-facing endpoint
Combining Services
text
Global web app: Front Door (global, WAF) → Application Gateway or App Service (regional) → VMs / containers
Internal tiers: Application Gateway → Internal Load Balancer → app VMs → Internal Load Balancer → database VMs
Non-HTTP global: Traffic Manager or cross-region Load Balancer → regional Standard Load Balancers
Practice
- Choose a service for: public API for users worldwide, internal SQL Server cluster, regional e-commerce with path routing, UDP game servers
- Build a Standard Load Balancer in front of two VMs and test failover
- Add path rules in an Application Gateway sketch
- Design active-passive failover with Traffic Manager priority routing
Conclusion
Load Balancer is layer 4 and regional, Application Gateway is layer 7 and regional with WAF, Front Door is global layer 7 with CDN, and Traffic Manager is DNS routing. Choose by protocol and scope and combine them for global designs.
Quick Summary: four services; flow; Load Balancer; App Gateway; Front Door; Traffic Manager; combining.

