Why Load Balancing Matters
High availability isn’t just about redundancy — it’s also about spreading traffic so no single resource is overwhelmed.
Azure provides Layer 4 and Layer 7 load balancers to keep apps resilient and scalable.
Azure Load Balancer (Layer 4)
-
Operates at Transport Layer (TCP/UDP).
-
Distributes traffic across VMs or VM Scale Sets.
-
Supports public (internet-facing) and internal load balancing.
-
Uses health probes to detect unhealthy instances.
Use Case:
-
Distribute TCP traffic (e.g., SQL, RDP, web traffic without inspection).
Azure Application Gateway (Layer 7)
-
Operates at Application Layer (HTTP/HTTPS).
-
Supports URL-based routing, host-based routing, and Web Application Firewall (WAF).
-
Can do SSL termination (decrypt/re-encrypt traffic).
-
Provides session affinity for sticky sessions.
Use Case:
-
Route
/imagesto one backend pool,/videosto another. -
Protect apps with WAF against SQL injection or XSS.
Azure Front Door
-
Global Layer 7 load balancer with content delivery (CDN) and application acceleration.
-
Routes traffic to the nearest healthy backend (multi-region).
-
Adds resiliency at a global scale.
Use Case:
-
Multi-region apps needing performance + HA.
Traffic Manager
-
DNS-based global traffic routing.
-
Routes traffic based on:
-
Priority (failover).
-
Performance (closest endpoint).
-
Geographic rules.
-
-
Works at DNS level, not as a load balancer.
Use Case:
-
Redirect users to the closest regional datacenter.
Confusion Buster 🚨
-
Load Balancer vs App Gateway
-
LB = Layer 4, TCP/UDP only.
-
App Gateway = Layer 7, HTTP/HTTPS + WAF.
-
-
Front Door vs Traffic Manager
-
Front Door = real-time routing + CDN, Layer 7.
-
Traffic Manager = DNS-based redirection, not true load balancing.
-
Exam trap: If question says “URL-based routing” → App Gateway. If it says “multi-region DNS failover” → Traffic Manager. If it says “global load balancer with acceleration” → Front Door.
Simple Example
A shopping website:
-
Uses Application Gateway with WAF for frontend web apps.
-
Uses Internal Load Balancer to spread SQL DB traffic.
-
Uses Traffic Manager for failover between East US and West Europe regions.
-
Adds Front Door to accelerate content globally.
Exam Tip
-
“Distribute TCP traffic inside a region” → Load Balancer.
-
“Route HTTP traffic with WAF” → Application Gateway.
-
“Multi-region, DNS-based failover” → Traffic Manager.
-
“Global load balancing with CDN + acceleration” → Front Door.
What to Expect in the Exam
-
Direct Q: “Which service provides Layer 7 load balancing with WAF?” → Application Gateway.
-
Scenario: “Global app needs users routed to nearest region automatically.” → Traffic Manager or Front Door (depending on Layer 7 vs DNS).
-
Trick Q: “Azure Load Balancer can inspect HTTP headers.” (False — only App Gateway/Front Door can).