Lesson 3 of 4 Name Resolution and Load Balancing in Azure

Distributing Traffic with Azure Load Balancer

This lesson explains public and internal load balancers, their components and how Load Balancer compares with other load-balancing services.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish between public and internal load balancers.
  • Describe the load balancer components and session persistence options.
  • Choose between Load Balancer and layer 7 services.

Public and internal load balancers

A public load balancer has a public IP address as its frontend and balances internet traffic to backend VMs; it also provides outbound connectivity for them through source network address translation (SNAT) with outbound rules. An internal load balancer has a private IP address in a VNet subnet as its frontend and balances traffic from inside the VNet, peered VNets or on-premises networks, for example from web servers to an application tier, or for a SQL Server Always On listener.

The Standard SKU is the current SKU: up to 5,000 backend instances in one VNet, HTTPS health probes, zone-redundant or zonal frontends, HA ports, outbound rules, Azure Monitor multi-dimensional metrics and a 99.99% SLA. It is secure by default: inbound flows are blocked unless an NSG allows them. The Basic SKU retired on 30 September 2025. The Gateway SKU inserts third-party NVAs transparently, and a cross-region (Global tier) load balancer distributes traffic across regional load balancers.

Sort into groups

Public or internal?

Exam skills 4.3.2

Choose the load balancer type for each scenario.

Log in to try this activity Interactive activities are free with an account.

Components

A load balancer is built from the components below, configured in this order.

  1. Frontend IP configuration

    A public IP (public load balancer) or a private IP in a subnet (internal), zone-redundant by default.

  2. Backend pool

    VM network interfaces or IP addresses in one VNet, or a scale set; instances need not be in an availability set.

  3. Health probe

    TCP, HTTP or HTTPS on a port (and path) with an interval; an instance is removed from rotation after failing the probe.

  4. Load-balancing rule

    Maps a frontend IP and port to a backend pool and port with a probe, session persistence, idle timeout and optional floating IP.

  5. Inbound NAT rule

    Forwards a frontend port (or port range) to a specific backend instance, for example SSH to one VM.

  6. Outbound rule

    Defines SNAT for backend instances' outbound internet traffic (public load balancers).

Session persistence (distribution mode) decides how flows are spread. None, the default, uses a five-tuple hash (source IP, source port, destination IP, destination port, protocol), so successive requests from a client can reach different instances. Client IP (two-tuple) sends all traffic from one client IP to the same instance, and Client IP and protocol (three-tuple) does so per protocol. HA ports, on internal Standard load balancers, balance all ports and protocols with one rule, which is used for NVAs.

The following diagram shows an internal load balancer for an application tier and its configuration.

A Standard internal load balancer for the application tier. A zone-redundant private frontend in subnet App feeds a backend pool of three VMs with a TCP 8443 health probe; the load-balancing rule for 8443 uses client IP session persistence; and an inbound NAT rule maps frontend port 50001 to SSH on app VM 1.
The scenario is illustrative.
Match the pairs

Load balancer components

Exam skills 4.3.2

Match each requirement with the load balancer component that meets it.

Log in to try this activity Interactive activities are free with an account.

Load Balancer compared with other services

Load Balancer works at layer 4 and does not inspect HTTP. Requirements such as URL path-based routing, host-based routing, TLS termination, cookie-based affinity or a web application firewall need Application Gateway (regional, layer 7) or Azure Front Door (global, layer 7). The table below summarizes the choice.

RequirementService
TCP/UDP balancing to VMs in a region, public or internalAzure Load Balancer
HTTP routing by path or host, TLS termination, WAF in a regionApplication Gateway
Global HTTP acceleration and failover with WAFAzure Front Door
DNS-based routing across regionsTraffic Manager
Sort into groups

Which load-balancing service?

Exam skills 4.3.2

Choose the service that meets each requirement.

Log in to try this activity Interactive activities are free with an account.
Worked example

An internal application tier

Web VMs in subnet Web must reach three application VMs in subnet App on TCP 8443, spread across availability zones. Each web server must keep using the same application server for the duration of a user session, which is identified only by client IP. Administrators must reach app VM 1 on SSH through the load balancer's frontend on port 50001. What should you configure?

Create a Standard internal load balancer with a zone-redundant private frontend in subnet App, a backend pool with the three VMs, a health probe on TCP 8443, a load-balancing rule for port 8443 with session persistence Client IP, and an inbound NAT rule mapping frontend port 50001 to port 22 on app VM 1. Make sure the NSGs on subnet App allow 8443 and 22 from the right sources. A public load balancer would expose the tier to the internet.

Check yourself

What is the default session persistence of an Azure load-balancing rule?

Show answer

None, which distributes flows with a five-tuple hash.

Exam Tips

Remember for the exam

  • Public frontend: internet traffic; internal frontend: private traffic within the network.
  • Standard Load Balancer is closed by default; NSGs must allow the traffic.
  • Session persistence Client IP keeps a client on one backend.
  • Layer 7 features need Application Gateway or Front Door, not Load Balancer.