Load Balancer
Public and internal · backend pools · probes · rules · outbound and SNAT · troubleshooting
By the tools4free.dev team · Last reviewed November 13, 2026
Practice questions for this topic →
Components and types
- Azure Load Balancer works at layer 4 (TCP and UDP). The frontend IP type decides the type: a public IP makes a public load balancer, a private IP makes an internal one. An internal load balancer can't accept traffic from the internet.
- Components: frontend IP configuration, backend pool, health probe, load-balancing rules (inbound only), HA ports, inbound NAT rules and outbound rules.
- Backend pool: VMs or scale set instances in a single virtual network, added by NIC or by IP address. VMs need no public IP and can be added while stopped. A private endpoint can't be a pool member. Rules and frontends can't span two vnets.
- Load-balancing rule spreads traffic to all pool members. An inbound NAT rule forwards a frontend port to one specific backend VM (for example RDP to each VM). Inbound NAT rules don't need a probe.
- HA ports: a rule with protocol All and port 0 on an internal Standard load balancer, used for NVAs. Not available on public load balancers or Basic.
- Limits: rules support TCP and UDP only (ICMP only with HA ports on internal Standard). No IP fragments. An outbound flow from a backend VM to the frontend of the same internal load balancer fails.
SKUs
- Standard is current. Basic was retired on Sep 30, 2025: upgrade to Standard (the public IP must become Standard at the same time). Gateway SKU is for third-party NVAs.
- Standard: TCP and UDP, probes TCP, HTTP and HTTPS, zone-redundant or zonal frontends, 99.99% SLA, HA ports on internal, outbound rules, TCP reset, multiple frontends, global tier.
- Standard is closed to inbound traffic until an NSG allows it. With no NSG on the subnet or NIC, traffic isn't allowed in. Backend NICs should be in an NSG. Basic was open by default.
- The public IP SKU must match the load balancer SKU (Standard with Standard). A VM, availability set or scale set can reference only one SKU.
- A resource group move works for a Standard load balancer and Standard public IP. Subscription moves aren't supported for Standard.
- Standard internal load balancer frontends are reachable over global vnet peering. Basic isn't.
Distribution modes
| Portal session persistence | Hash | REST name |
|---|---|---|
| None (default) | 5-tuple | Default |
| Client IP | 2-tuple (source IP, destination IP) | SourceIP |
| Client IP and protocol | 3-tuple | SourceIPProtocol |
Switching modes causes no downtime. Backend pool membership changes recompute the distribution.
Health probes
- Probe types: TCP (3-way handshake), HTTP and HTTPS. HTTP and HTTPS expect HTTP 200. A non-200 response marks the instance down immediately. Basic doesn't support HTTPS.
- Default interval: 5 seconds in the portal, 15 seconds from CLI, PowerShell, templates and REST (minimum 5). HTTP and HTTPS probe timeout is 30 seconds. The threshold is the number of consecutive successes or failures.
- The probe source is
168.63.129.16(service tag AzureLoadBalancer). Allow it in NSGs and the guest firewall. Don't use a vnet range that includes it. - HTTP probes can't use ports 19, 21, 25, 70, 110, 119, 143, 220 or 993. No hostnames. HTTPS probes use no client certificate. The VM must listen on the probe port. Stopped VMs aren't probed.
- Probe down (Standard): one instance down means new connections go to healthy ones and established TCP flows continue. All down means no new flows, and established TCP flows continue (when there is more than one backend). UDP flows terminate. Probe failure affects only inbound, not outbound.
- Probe validation happens only in the portal. CLI and PowerShell don't check.
Outbound rules and SNAT basics
- Outbound rules explicitly define SNAT for a Standard public load balancer. They aren't available on Basic.
- Each frontend public IP provides 64,000 SNAT ports. Ports per instance = number of frontend IPs × 64K ÷ number of backend instances. Allocate manually by ports per instance for VMs, or by maximum number of backend instances for scale sets.
- Default allocation (when
allocatedOutboundPortsis 0 ordisableOutboundSnatis false on a rule) uses a table by pool size (per frontend IP): 1 to 50 VMs get 1,024, 51 to 100 get 512, 101 to 200 get 256, 201 to 400 get 128, 401 to 800 get 64, 801 to 1,000 get 32. With more frontend IPs the per-VM total is table value × frontend IPs, capped at 1,024 (100 VMs: 512 each, 1,024 with two IPs, still 1,024 with three). Don't use default allocation in production. - Each port used by a load-balancing or inbound NAT rule consumes a range of eight SNAT ports. Idle SNAT ports are released after 4 to 120 minutes (configurable in outbound rules). UDP uses one SNAT port per destination IP.
- Exhaustion fixes: reuse connections, add frontend IPs, use a NAT gateway, or use Private Link for PaaS.
- Outbound rules don't support secondary IPv4 configurations of a NIC.
- Default outbound access is turned off when a VM joins a Standard load balancer backend pool. Standard internal backends have no default internet access. Give them a NAT gateway (recommended: it avoids the SNAT port exhaustion limits of outbound rules), a public IP on each VM NIC, or membership in a separate Standard public load balancer's pool with outbound rules.
Floating IP
- Floating IP is required to reuse the backend port across multiple rules (clustering, NVAs, several TLS endpoints, a SQL Always On listener).
- Enabled: Azure maps to the load balancer frontend IP. Disabled: Azure exposes the VM instance IP.
- The guest OS must be set up: a loopback interface with the frontend IP, weak host model on Windows (
netsh interface ipv4 set interface <name> weakhostreceive=enabled), and a host firewall that allows the port. - It can't be used on secondary IP configurations (with a few dual-stack and NAT gateway exceptions).
Troubleshooting
| Symptom | Check |
|---|---|
| No inbound connectivity to a Standard public load balancer | Add an NSG (subnet or NIC) allowing the port, then check probe state, the rule, the backend listener and the guest firewall |
| Health probe shows down | Backend VM unhealthy; VM not listening on the probe port (netstat -an should show LISTENING); a firewall or NSG blocking the probe port, including a Deny All rule with higher priority than the default rule that allows load balancer probes; a UDR sending probe packets elsewhere. Try another probe type (HTTP to TCP) |
| Tracing a probe problem | Test with PsPing or TCPing from another VM. No incoming packets on the backend points to NSG or UDR. No outgoing packets points to the VM or application |
| Non-HTTP service | Use a TCP probe on a port that represents service health (for example AD DS LDAP 389) |
| No outbound from a Standard internal load balancer | Standard internal load balancers don't provide default outbound access: add a NAT gateway, public IPs or an outbound-rule load balancer |
To simulate a probe failure, use an NSG rule that blocks the probe port. Blocking the probe IP and port in an NSG is otherwise unsupported.
CLI and PowerShell
| Task | Command |
|---|---|
| Create a Standard public load balancer | az network lb create -g rg -n load-balancer --sku Standard --public-ip-address lb-frontend-ip --frontend-ip-name lb-frontend --backend-pool-name lb-backend-pool |
| Create an internal load balancer | az network lb create -g rg -n load-balancer --sku Standard --vnet-name lb-vnet --subnet backend-subnet --backend-pool-name lb-backend-pool --frontend-ip-name lb-frontend (no public IP, so the frontend takes a private IP from the subnet) |
| Health probe | az network lb probe create -g rg --lb-name load-balancer -n lb-health-probe --protocol tcp --port 80 |
| Load-balancing rule | az network lb rule create -g rg --lb-name load-balancer -n lb-HTTP-rule --protocol tcp --frontend-port 80 --backend-port 80 --frontend-ip-name lb-frontend --backend-pool-name lb-backend-pool --probe-name lb-health-probe --disable-outbound-snat true --idle-timeout 15 --enable-tcp-reset true |
| Add a NIC to the backend pool | az network nic ip-config address-pool add --address-pool lb-backend-pool --ip-config-name ipconfig1 --nic-name lb-VM1-nic -g rg --lb-name load-balancer |
| NSG allow rule | az network nsg rule create -g rg --nsg-name lb-nsg -n lb-nsg-rule --protocol '*' --direction inbound --destination-port-range 80 --access allow --priority 200 |
| NAT gateway on the subnet | az network vnet subnet update --nat-gateway lb-nat-gateway (after az network nat gateway create) |
| PowerShell building blocks | New-AzLoadBalancerFrontendIpConfig, New-AzLoadBalancerBackendAddressPoolConfig, New-AzLoadBalancerProbeConfig, New-AzLoadBalancerRuleConfig (-EnableFloatingIP, -LoadDistribution SourceIP, -DisableOutboundSNAT), then New-AzLoadBalancer -Sku Standard |
Limits
| Item | Value |
|---|---|
| Standard backend pool size | 5,000 |
| Standard frontend IP configurations | 600 |
| Standard rules (load-balancing plus inbound NAT) per resource | 1,500 |
| Standard outbound rules per load balancer | 600 |
| Standard SLA | 99.99% |
Exam Tips
Tick each tip once you can answer it without looking.
“Standard public load balancer; internet requests to the VMs time out; no NSG exists” → Standard is closed by default: add an NSG that allows the port. Trap: adding an inbound NAT rule.
“Backend instance marked unhealthy while the app works locally” → Allow AzureLoadBalancer (168.63.129.16) in NSGs and the guest firewall, and confirm the probe port is listening. Trap: giving the VM a public IP.
“HTTP probe gets 301, 403 or 500” → Treated as down: the probe needs HTTP 200. Trap: any response counting as healthy.
“Need an HTTPS health probe” → Standard SKU. Trap: Basic does not support HTTPS probes.
“Standard load balancer with a Basic public IP” → Not supported: both must be Standard. Trap: it being allowed in the same region.
“Same client IP must reach the same VM, based on source and destination IP” → Session persistence Client IP (2-tuple). Trap: the default, None, which hashes the 5-tuple.
“Default distribution mode” → 5-tuple hash (session persistence None). Trap: source IP affinity.
“Change the distribution mode” → No downtime. Trap: recreating the rule.
“RDP to each backend VM separately through one public IP” → Inbound NAT rules. Trap: a load-balancing rule on 3389.
“Load balance every port to NVA firewalls behind an internal load balancer” → HA ports rule (protocol All, port 0) on an internal Standard load balancer. Trap: one rule per port, or a public load balancer.
“A backend VM calls its own internal load balancer frontend and it fails” → A backend VM can't connect to the frontend of the same internal load balancer: test from another client. Trap: adding an NSG rule.
“Backend VMs behind a Standard load balancer need internet access” → Add a NAT gateway, instance public IPs or outbound rules; there is no default outbound once in the pool. Trap: assuming nothing is needed.
“Backend VMs behind a Standard internal load balancer cannot reach the internet” → Add a NAT gateway (recommended), a public IP per NIC, or outbound rules on a Standard public load balancer. Trap: an inbound NAT rule or opening outbound in the NSG.
“Outbound connections fail intermittently with many VMs behind one frontend IP” → SNAT port exhaustion: use a NAT gateway, add frontend IPs, allocate ports manually and reuse connections. Trap: a larger VM size.
“SNAT ports per frontend IP, and per instance with manual allocation” → 64,000 per frontend IP; ports per instance = frontend IPs × 64K ÷ backend instances. Trap: relying on default allocation in production.
“Two rules must use the same backend port (SQL Always On listener)” → Enable Floating IP and configure the guest OS loopback with the frontend IP. Trap: Client IP session persistence.
“All probes down on a Standard load balancer” → No new connections; established TCP flows continue. Trap: all flows being reset.
“Move a Standard load balancer to another subscription” → Not supported (a resource group move is). Trap: the move working for any subscription.
“Private endpoint as a backend pool member” → Not supported. Trap: the IP-based pool accepting it.
“Probe interval for a probe created with the CLI” → 15 seconds (the portal default is 5). Trap: assuming 5 in every tool.
Sources
- Azure Load Balancer SKUs
- Azure Load Balancer components
- Azure Load Balancer health probes
- Azure Load Balancer distribution modes
- SNAT for outbound connections
- Azure Load Balancer Floating IP
- Quickstart: create a public load balancer (CLI)
- Quickstart: create an internal load balancer (CLI)
- Troubleshoot no inbound connectivity to Standard external load balancers
- Troubleshoot no outbound connectivity from Standard internal load balancers
- Troubleshoot Azure Load Balancer health probe status
- Upgrade Basic public IP to Standard
- Azure subscription and service limits
- New-AzLoadBalancer
Checked against Microsoft Learn on November 13, 2026.