Skip to main content

Azure Load Balancer

Azure Load Balancer is a Layer 4 service that distributes TCP and UDP traffic across healthy VMs or scale set instances. It is high-throughput and protocol-agnostic and does not inspect HTTP content.

Azure Load Balancer

Azure Load Balancer spreads incoming connections across a backend pool using a hash of the connection details, and health probes remove unresponsive instances from rotation. It can be public (internet-facing) or internal (private frontend inside a virtual network). Only the Standard SKU should be used for new work, because the Basic SKU was retired in September 2025.

What Are the Parts of a Load Balancer?

  • Frontend IP: The address clients connect to.
  • Backend pool: The VMs or scale set instances that receive traffic.
  • Health probe: A TCP, HTTP, or HTTPS check that decides if an instance is healthy.
  • Load-balancing rule: Maps a frontend port to a backend port.
  • Outbound rule: Controls how backend VMs reach the internet.
flowchart LR C(["Clients"]):::person -->|TCP 443| LB["Standard
Load Balancer"]:::tool LB -->|probe ok| V1["VM 1"]:::cloud LB -->|probe ok| V2["VM 2"]:::cloud LB -.->|probe failed| V3["VM 3 removed"]:::bad classDef person fill:#EDE9FE,color:#1E293B classDef tool fill:#326CE5,color:#FFFFFF classDef cloud fill:#D1FAE5,color:#1E293B classDef bad fill:#FEE2E2,color:#1E293B

How Do You Create a Standard Load Balancer?

Bash
az network lb create --resource-group mumbai-prod-rg \
--name order-matching-lb --sku Standard \
--frontend-ip-name lb-frontend --backend-pool-name order-matching-pool
az network lb probe create --resource-group mumbai-prod-rg \
--lb-name order-matching-lb --name tcp-probe \
--protocol tcp --port 8443 --interval 5

Why It Matters in Production

A delivery platform like Swiggy can place its order-matching scale set behind a Standard Load Balancer, which handles heavy TCP traffic with low latency and automatically stops sending traffic to nodes that fail their probe.

Common Mistake

Forgetting that Standard Load Balancer is closed by default. Inbound traffic needs an NSG allow rule, and backend VMs need an explicit outbound rule, NAT gateway, or public IP to reach the internet.

Remember

Need URL routing, TLS termination, or WAF? Use Application Gateway. Need global distribution? Use Front Door or the cross-region load balancer.

Frequently Asked Questions

What is the difference between Azure Load Balancer and Application Gateway?

Load Balancer works at Layer 4 and never reads HTTP, while Application Gateway works at Layer 7 and can route by path, host, or cookie and run a WAF. Choose by protocol and routing needs.

Why can my VM no longer reach the internet behind a Standard Load Balancer?

Standard SKU uses secure-by-default outbound behaviour, so a backend VM needs an outbound rule, a NAT gateway, or its own public IP. Relying on implicit default outbound access is no longer supported for new virtual networks.

How does the health probe affect traffic?

An instance that fails the probe stops receiving new connections until it passes again. A probe that returns healthy while the app is degraded keeps sending traffic to a broken instance, so probe a real health endpoint.

Found a mistake, an outdated step or a broken link?