Azure Load Balancer: Public and Internal Load Balancing, Probes, Rules, NAT and Outbound Connectivity

Microsoft Certified Azure Administrator Associate AZ 103 55 min min read Updated: Nov 17, 2026 Intermediate
Azure Load Balancer: Public and Internal Load Balancing, Probes, Rules, NAT and Outbound Connectivity
Intermediate Topic 1 of 3

What It Does

Azure Load Balancer works at layer 4 (TCP and UDP). It spreads incoming connections across healthy VMs in a backend pool. It is very fast and supports any application protocol.

TypeUse
Public load balancerInternet traffic to VMs (public frontend IP)
Internal load balancerTraffic inside a VNet or from on-premises (private frontend IP)
SKUNotes
StandardZone-redundant, up to 1000 instances, SLA, secure by default (needs NSG to allow traffic). Use for production
BasicBeing retired. Do not use for new work

Components

PartMeaning
Frontend IPThe address clients connect to
Backend poolThe VMs or scale set instances that receive traffic
Health probeChecks each VM (TCP, HTTP or HTTPS). Unhealthy instances stop getting traffic
Load balancing ruleMaps frontend port to backend port (for example 80 to 80)
Inbound NAT ruleForward a specific port to one VM (for example 50001 to VM1 port 22)
Outbound ruleControls SNAT for outbound internet access

Create a Public Load Balancer

bash az network public-ip create -g rg-lb -n pip-lb --sku Standard --zone 1 2 3 az network lb create -g rg-lb -n lb-web --sku Standard --frontend-ip-name fe --public-ip-address pip-lb --backend-pool-name be az network lb probe create -g rg-lb --lb-name lb-web -n probe-http --protocol Http --port 80 --path /health az network lb rule create -g rg-lb --lb-name lb-web -n rule-http --protocol Tcp --frontend-port 80 --backend-port 80 \ --frontend-ip-name fe --backend-pool-name be --probe-name probe-http --idle-timeout 4 --load-distribution Default # add NICs to the backend pool az network nic ip-config address-pool add -g rg-lb --nic-name nic-web1 --ip-config-name ipconfig1 --lb-name lb-web --address-pool be

Distribution Modes

ModeBehavior
Default (5-tuple hash)Source IP, source port, destination IP, destination port, protocol. Spreads connections
Source IP affinity (2-tuple)Same client IP goes to the same VM
Source IP and protocol (3-tuple)Same client and protocol to the same VM

Internal Load Balancer

bash az network lb create -g rg-lb -n lb-db --sku Standard --vnet-name vnet-app --subnet data --frontend-ip-name fe-int --backend-pool-name be-db --private-ip-address 10.20.2.100
  • Used between tiers (web to app to database) and for HA ports with firewalls (all ports at once)

Outbound and Troubleshooting

  • VMs behind a Standard LB without public IPs need outbound rules or a NAT Gateway for internet access. NAT Gateway is the recommended option
  • Probe failing? Check the NSG allows the AzureLoadBalancer tag, the app answers on the probe port and path, and the OS firewall allows it
  • Use Metrics: Health probe status, Data path availability, SNAT connections

Practice

  1. Create a Standard public LB with two VMs running a web page
  2. Browse the frontend IP and refresh to see both VMs
  3. Stop the web service on one VM and watch the probe remove it
  4. Create an inbound NAT rule for SSH to one VM

Conclusion

Load Balancer distributes layer 4 traffic using frontends, backend pools, probes and rules. Use Standard SKU, allow probe traffic in NSGs and plan outbound access with NAT Gateway.

Quick Summary: what; components; create; modes; internal; outbound and troubleshooting.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators