Azure Load Balancer

Azure Load Balancer

A complete, plain-English guide to the service that spreads network traffic across many servers: how it is built, how it decides, how it survives failure, and how to run it well in production.

Picture a busy supermarket on a Saturday morning. Twelve checkout lanes are open, but every shopper rushes to lane one. Lane one grows a huge queue, the cashier gets overwhelmed, and the other eleven cashiers stand idle. Then the cashier in lane one goes home sick, and everyone in that queue is stuck. Now picture a friendly store worker standing at the front, pointing each shopper to the shortest open lane and quietly closing any lane whose cashier has stepped away. That worker turns a chaotic store into a smooth one.

Computer systems face exactly the same problem. A website, a game server, or a database does not run on one machine. It runs on many, and something has to point each incoming request to a healthy machine. In Azure, one of the main tools for that job is Azure Load Balancer. In this guide you will learn what it is, why it exists, every part inside it, and the mistakes that trip up even experienced engineers. Each new word is explained the first time it appears, so you can start with no background at all.

1What Azure Load Balancer Is

Start with the big picture: what it does, where it lives, and what it does not do.

A load balancer is a traffic director. It receives network connections from users and hands each one to one of several servers behind it. The word load means the amount of work, and balancing means sharing that work fairly. Azure Load Balancer is Microsoft’s built-in, fully managed load balancer for the Azure cloud. You do not install it on a machine, patch it, or restart it. You describe what you want in the Azure portal, and Azure runs the traffic director for you.

It works at what network engineers call Layer 4. Networking is described in layers, like floors of a building. Layer 7 is the top floor, where the web conversation happens: web addresses, cookies, and page contents. Layer 4 is a lower floor, called the transport layer, which only sees TCP and UDP connections. TCP is the careful protocol that makes sure every piece of data arrives in order, like registered mail. UDP is the quick protocol that just sends, like a postcard. A Layer 4 load balancer looks only at the envelope of a message: where it came from, where it is going, and which protocol it uses. It does not open the letter.

Analogy

Think of a mailroom clerk in a big office tower. The clerk reads only the apartment number on each envelope and drops it into the right mailbox. The clerk never reads the letter inside. That is why the clerk is extremely fast. Azure Load Balancer is that clerk for network connections.

Layer 4
Works with TCP and UDP connections
99.99%
Availability target for the Standard SKU
Zero
Servers for you to patch or restart

A short history

Load balancing is older than the cloud. In the 1990s companies bought expensive hardware boxes to spread web traffic. When Azure launched, it needed its own built-in version that could handle millions of connections without anyone buying a box. Microsoft built the Azure load balancer as software that runs across its data centers, and researchers there have publicly described the early ideas behind it. Over the years the service gained health checks, zone support, a Standard version with stronger guarantees, a global tier for spreading traffic across regions, and a gateway version for security appliances. The older Basic version was retired in September 2025, so everything today builds on the Standard family.

i
Tip

Limits, prices, and region support change over time. Use the ideas in this guide as a map and confirm exact numbers in Microsoft’s current documentation before you finalize a design.

2The Problem It Solves

Every tool exists because something hurt. Here is what hurts without a load balancer.

Imagine you run an online shop on a single server. On a normal day it copes. On the day of a big sale, ten times more shoppers arrive, and the server runs out of memory and processing power, a state called overload. Pages crawl, then stop. You could buy a bigger server, which is called scaling up, but there is always a limit to how big one machine can be, and a bigger machine still fails as a single point.

The alternative is scaling out: run many ordinary servers side by side and share the traffic. This is cheaper, more flexible, and more resilient. But it creates a new question. Shoppers type one address into their browser. Which of the many servers answers? Somebody has to be the single front door. That is the load balancer.

A second problem is failure. Servers crash, get patched, or run out of disk space. Without a traffic director, users keep being sent to a dead machine and see errors. With a load balancer, a failed server is detected and quietly skipped. This idea is called high availability, which simply means the service stays up even when parts of it break.

Pain 1

One server cannot take the crowd

Traffic spikes overwhelm a single machine, and there is a ceiling on how big a machine can be.

Pain 2

Failures become outages

When the only server dies, the whole service dies with it.

Pain 3

Updates cause downtime

Patching the only server means taking the service offline.

Pain 4

Which server do I call?

Users and applications need one stable address, even as servers come and go.

Everyday example: the ticket website

A concert ticket site opens sales at noon. Thousands of fans click at once. Behind one public address sit twelve web servers. The load balancer spreads the connections across all twelve. When one server crashes at 12:03, the load balancer notices within seconds and stops sending it fans. Most buyers never realize anything went wrong.

3Core Concepts: Types, Tiers, and SKUs

Before diving into parts, learn the few labels that Azure puts on every load balancer.

An Azure load balancer has a type. A public load balancer has a public IP address that anyone on the internet can reach. It receives traffic from outside and sends it to your servers. An internal load balancer, also called a private load balancer, has only a private address inside your own virtual network. It spreads traffic between your own tiers, for example from web servers to application servers, and cannot be reached from the internet. A virtual network, shortened to VNet, is your private network inside Azure.

It also has a SKU, a word meaning product edition. The Standard SKU is the main one. It is designed for production, works across availability zones, and is secure by default, meaning it blocks inbound traffic until you explicitly allow it using a network security group, which is a list of allow and deny rules. The older Basic SKU has been retired. There is also the Gateway SKU, a special type built for security and network appliances, which you will meet later.

Finally there is a tier. The default is the Regional tier, which balances traffic among servers inside one Azure region. The Global tier, sometimes called cross-region, sits in front of several regional load balancers and spreads traffic across regions around the world.

LabelOptionsWhat it decides
TypePublic or InternalWho can reach the front door: the internet or only your network
SKUStandard or GatewayFeature set and purpose
TierRegional or GlobalWhether it works inside one region or across many
Analogy

A public load balancer is the main street entrance of a shopping center, open to everyone. An internal load balancer is a staff-only corridor between the stockroom and the shop floor. The global tier is the head office that decides which shopping center, in which city, a visitor should be sent to.

!
Warning

Azure Load Balancer is not a web-aware device. It cannot read web addresses, rewrite pages, or remove encryption from web traffic. If you need those things, you need a Layer 7 service such as Application Gateway, which is compared later in this guide.

4Architecture and Components

An Azure load balancer is made of five simple building blocks. Once you know them, every design becomes a puzzle of arranging the same pieces.

The first building block is the frontend IP configuration. This is the address that clients connect to. It can be a public IP address or a private one. The second is the backend pool, the group of servers that actually do the work. The third is the health probe, a small repeated check that asks each server, “Are you alive and ready?” The fourth is the load balancing rule, which says “traffic arriving at this frontend address and port should go to the backend pool on that port.” The fifth family includes inbound NAT rules and outbound rules, which handle special cases such as reaching one particular server or letting servers go out to the internet.

flowchart LR
    C["Clients on internet"] --> FE["Frontend IP configuration"]
    FE --> R["Load balancing rule"]
    R --> BP["Backend pool"]
    HP["Health probe"] -.->|"checks every server"| BP
    BP --> S1["Server 1"]
    BP --> S2["Server 2"]
    BP --> S3["Server 3"]
    N["Inbound NAT rule"] -.-> S1
    O["Outbound rule"] -.-> BP
    
Figure 1. The building blocks of one load balancer and how they connect.

Read the picture from left to right. A client connects to the frontend address. The load balancing rule matches that connection and chooses the backend pool. Inside the pool, the load balancer picks one healthy server. Meanwhile the health probe keeps watching every server and tells the load balancer which ones may receive new traffic. The dotted lines show the optional helpers: a NAT rule can point a specific port to one specific server, and an outbound rule lets the servers reach out to the internet.

Block 1

Frontend IP

The stable address clients use. It never changes even when servers do.

Block 2

Backend pool

The list of virtual machines or scale set instances that receive traffic.

Block 3

Health probe

A recurring check that marks each server healthy or unhealthy.

Block 4

Load balancing rule

Connects a frontend address and port to a backend pool and port.

Block 5

NAT and outbound rules

Handle single-server access and internet-bound traffic.

Helper

Network security group

Allows or denies the traffic at the servers. Required with the Standard SKU.

5Frontends and Backend Pools in Detail

The two ends of the pipe: where traffic enters and where it ends up.

A frontend IP is simply an address. For a public load balancer, it is a public IP address resource, and with the Standard SKU this address is static, meaning it does not change. For an internal load balancer, the frontend is a private address picked from one of your subnets. A subnet is a slice of your virtual network. One load balancer can have many frontends, which is useful when one pool of servers hosts several websites or services, each reachable at its own address.

Frontends also have a zone setting. A zone-redundant frontend is served from all availability zones of a region at once and survives the loss of any one of them. An availability zone is a physically separate building within an Azure region, with its own power, cooling, and network. A zonal frontend is tied to one chosen zone. A frontend can also be non-zonal, which leaves placement to Azure. For most production designs, zone-redundant is the sensible default.

The backend pool is the list of destinations. Members can be virtual machines, the instances in a virtual machine scale set (a group of identical machines that can grow and shrink automatically), or plain IP addresses. Membership can be defined by the machine’s network card or directly by IP address. Adding a new server to the pool takes effect within moments, and removing one lets in-flight connections finish in an orderly way. A Standard load balancer supports a very large number of backend instances, in the thousands, which is plenty for nearly any design.

Analogy

The frontend is the company’s single published phone number. The backend pool is the list of support agents who actually answer calls. Customers never need to know how many agents there are, who is on break, or who just joined. They always dial the same number.

i
Tip

Keep all machines in one backend pool identical in role and size. A pool that mixes strong and weak servers makes traffic distribution uneven, because the load balancer does not know how powerful each server is.

Everyday example: scale set behind a front door

A video site runs its web servers in a scale set. At night there are four instances, at peak hour there are forty. The scale set joins and leaves the backend pool automatically, and the load balancer keeps the same public address throughout. Viewers never see the change.

6Health Probes

The load balancer must never send visitors to a broken server. Health probes are how it knows.

A health probe is a tiny test that the load balancer repeats on every backend server at regular intervals. The simplest kind is a TCP probe: the load balancer tries to open a connection to a chosen port. If the server accepts it, the server is considered healthy. An HTTP probe or HTTPS probe goes one step further. It requests a specific web path, such as a health page, and expects a successful reply. This proves not just that the port is open but that the application is actually working.

Two numbers shape the behavior. The interval is how often the probe runs, commonly every few seconds. The threshold is how many failed attempts in a row mark a server as unhealthy. A server that fails the threshold is removed from rotation, meaning no new connections are sent to it. When it starts passing again, it is added back. Probes come from a special internal address, 168.63.129.16, which is Azure’s own platform address, so your firewall and security group rules must allow it or every server will look dead.

1

Probe runs on schedule

The load balancer sends a small check to each backend server every few seconds.

2

Server answers or does not

A healthy server replies. A failing one stays silent or sends an error.

3

Threshold is crossed

After enough misses in a row, the server is marked unhealthy.

4

New traffic stops flowing

The load balancer sends no new connections to that server.

5

Recovery

When the server passes probes again, it rejoins the rotation automatically.

What happens to connections already in progress

When a server turns unhealthy, existing TCP connections to that server are generally allowed to continue until they end, while new connections go elsewhere. If every server in a pool fails its probes, the load balancer ends existing TCP flows to the pool, because there is nowhere healthy to send them. UDP behaves differently, since it has no connection: new packets simply follow the healthy set.

Analogy

A health probe is like a manager walking past each cashier every few minutes and asking, “All good?” If a cashier does not answer after a few rounds, the manager puts up a “closed” sign on that lane. Shoppers already in the queue finish checking out, but nobody new joins it.

!
Warning

Point an HTTP probe at a light, dedicated health page. If the probe path runs heavy database queries, the probes themselves can overload your servers or fail during busy moments, which may cause servers to be removed exactly when you need them most.

7Load Balancing Rules and Distribution Modes

The rule is the brain. It decides which server gets each new connection.

A load balancing rule ties everything together. It says: “Traffic that arrives at this frontend IP, on this protocol and port, should be sent to this backend pool, on this port, as long as this health probe says the server is healthy.” One load balancer can hold many rules, so a single frontend address may serve web traffic on port 443 and another service on a different port.

To pick a server, Azure uses a hash. A hash is a mathematical shortcut that turns a list of values into a number, always giving the same number for the same inputs. By default Azure hashes five pieces of information about the connection, called the five-tuple: the source IP address, the source port, the destination IP address, the destination port, and the protocol. The resulting number maps to one backend server. Because the source port changes for each new connection, different connections from the same visitor may land on different servers, which spreads load evenly. All packets of one connection share the same five-tuple, so they always stay on the same server.

Sometimes you want a visitor to keep returning to the same server. This is called session persistence or source IP affinity. Azure then hashes only the source and destination addresses, a two-tuple, or adds the protocol for a three-tuple. Every connection from the same client address goes to the same server for as long as that server stays healthy and in the pool.

ModeWhat is hashedEffectGood for
Default five-tupleSource IP, source port, destination IP, destination port, protocolEven spread, new connections may move between serversStateless web and API servers
Source IP affinity, two-tupleSource IP and destination IPSame client goes to same serverApps that keep user data in server memory
Source IP and protocol, three-tupleSource IP, destination IP, protocolSame client and protocol go to same serverMixed TCP and UDP services needing stickiness
Analogy

The five-tuple hash is like a dealer dealing cards from a shuffled deck: each hand lands wherever the card falls, and the table stays evenly served. Source IP affinity is like a regular customer who always asks for the same waiter, so the waiter remembers their order.

Idle timeout and TCP reset

A connection that carries no data for a while is called idle. The load balancer keeps track of each connection, and if it stays idle too long, the load balancer forgets it. This idle timeout is configurable between four and thirty minutes. If the client later sends data on a forgotten connection, it fails. Two remedies exist: enable TCP keepalives, tiny periodic messages that prove the connection is alive, and enable TCP reset on idle, which tells both sides clearly that the connection ended so applications fail quickly and reconnect instead of waiting in confusion.

i
Tip

Design your application to be stateless, meaning each request carries what it needs or uses a shared store, so any server can answer any request. Then you will rarely need source IP affinity at all.

8Internal Working and Data Flow

Where does the load balancer actually live, and what happens to one packet from start to finish?

A common first guess is that Azure Load Balancer is a virtual machine somewhere with a lot of memory. It is not. It is a distributed, software-defined service built into Azure’s network fabric. Software-defined means the behavior is controlled by programs, not by one special box. Distributed means the work is spread across many machines, so there is no single device whose failure could take the load balancer down.

The publicly described design works in two broad parts. A pool of multiplexers, often shortened to muxes, receives traffic from the internet or the Azure network. Routing in the network spreads incoming packets across the muxes, so no single mux is a bottleneck. Each mux knows the mapping of frontends to backend servers and picks a destination using the hash described earlier. Then, on each physical host where your virtual machines run, a small component in the virtual switch, the software that connects virtual machines to the network, handles the final delivery and the return path.

One important result of this design is that the load balancer does not terminate your connection. It does not answer the client on behalf of the server. Instead it forwards packets, rewriting only the destination address to that of the chosen server. The server therefore sees the real client IP address. For many applications, such as ones that log users or apply per-client rules, this is a major advantage. On the way back, replies can often travel directly from the server to the client without passing through the load balancer again, a trick called direct server return, which saves capacity.

sequenceDiagram
    participant Client as Client
    participant Mux as Load balancer data path
    participant Host as Host virtual switch
    participant VM as Chosen backend server
    Client->>Mux: Connect to frontend IP and port
    Mux->>Mux: Hash five values and pick a healthy server
    Mux->>Host: Forward packet with new destination
    Host->>VM: Deliver packet with real client IP
    VM-->>Client: Reply goes back toward the client
    
Figure 2. Life of one connection: pick a server by hash, forward, and let the reply return directly.
Analogy

Imagine a switchboard operator who only connects your call to an agent, then leaves the line. The operator does not listen in or repeat your words. Because the operator is done after connecting you, a hundred operators can work at once, and one operator being absent never ends your call.

Step 1

Packet arrives

The network spreads incoming traffic across many load balancer data path machines.

Step 2

Hash decides

The five values of the connection produce a number that maps to one healthy server.

Step 3

Forward without terminating

Only the destination address is changed. The connection stays between client and server.

Step 4

Reply returns

The server answers the real client, often straight back without another trip through the balancer.

i
Tip

Because the load balancer never opens your traffic, encryption such as TLS passes through untouched. Your servers handle the certificates. If you want the front door to handle certificates for you, add a Layer 7 service in front.

!
Warning

A server in the backend pool of an internal load balancer cannot successfully connect to that same load balancer’s own frontend address. The reply would return to the same machine that asked, which the network cannot match to a connection. Use a different tier, or a different machine, as the caller.

9Inbound NAT Rules and Outbound Connectivity

Traffic does not only come in. Servers also need to go out, and sometimes you need to reach one server on purpose.

NAT stands for network address translation. It means swapping one address for another as packets pass through, like a receptionist who stamps the company’s main address on every outgoing letter while keeping track of which employee sent which one. NAT appears twice in a load balancer.

Inbound NAT rules

A load balancing rule sends a connection to any healthy server. Sometimes you want the opposite: to reach one specific server. An inbound NAT rule forwards a chosen frontend port to a chosen port on one chosen server. For example, frontend port 50001 could always lead to server one on its remote administration port. This is handy for management access, though modern designs often prefer safer tools such as Azure Bastion, a secure browser-based way to reach machines without exposing ports.

Outbound connectivity and SNAT

Your servers often need to call out: to download updates, call a payment service, or fetch data from an external site. Servers with only private addresses cannot simply send traffic to the internet, because a private address means nothing there. The solution is SNAT, source network address translation. The load balancer rewrites the private source address of each outgoing connection into one of its public frontend addresses, and remembers the mapping so replies come back to the right server.

Each public address offers about sixty-four thousand ports, which you can think of as numbered slots. Every outgoing connection to the same destination needs its own slot. A busy server that opens thousands of short connections to the same service can use up its share of slots, a problem called SNAT port exhaustion. When that happens, new outgoing connections fail or time out, which often looks like random application errors.

flowchart LR
    VM1["Server 1 - private IP"] --> LB["Outbound rule - SNAT"]
    VM2["Server 2 - private IP"] --> LB
    VM3["Server 3 - private IP"] --> LB
    LB -->|"Public IP and port slot"| NET["Internet service"]
    NET -->|"Reply"| LB
    LB -->|"Match slot and return"| VM1
    
Figure 3. Outgoing connections share a public address, each using its own port slot.
Analogy

SNAT is like a hotel front desk that has one main phone number but a hundred rooms. Each outgoing call is given a temporary extension number so the replies find the right room. If too many guests call the same number at once, the extension numbers run out and the next caller hears a busy signal.

Best choice

NAT Gateway

A dedicated Azure service for outbound traffic with many more port slots and simple scaling. Usually the recommended choice for busy outbound traffic.

Option

Outbound rules

Control exactly how many port slots each server gets from the load balancer’s public addresses.

Option

Public IP on each server

Gives a server its own address and ports, but exposes more surface area.

Reduce need

Connection reuse and private links

Reuse connections and use private endpoints for Azure services so fewer outgoing slots are needed.

!
Warning

Do not rely on hidden default outbound access. Newer virtual networks are private by default, which means servers get no automatic internet exit. Choose an explicit outbound method, preferably NAT Gateway, when you design the network.

10High Availability Ports and Floating IP

Two special features solve problems that ordinary rules cannot.

High availability ports

An ordinary rule handles one port, such as 443. But some servers, like firewalls and routing appliances, must handle traffic on every port at once. Writing thousands of rules would be silly. A high availability ports rule, usually called an HA ports rule, uses a single entry that says “all protocols, all ports.” It is available on an internal Standard load balancer and is the key tool for putting groups of network virtual appliances, which are virtual firewalls or routers from security vendors, behind a single address for resilience and scale.

Floating IP

Normally the load balancer rewrites the destination address to the chosen server’s own address. With floating IP, also called direct server return, the destination address is left as the frontend address, and the server is configured to accept traffic for that address. This lets several servers share the same address and port, or lets one cluster move a service from one server to another by simply deciding which server answers for the address. It is widely used by database clusters such as SQL Server Always On availability groups, where a listener address must always point to whichever server currently holds the main copy of the data.

Analogy

Floating IP is like a company hotline number that is forwarded to whichever manager is on duty today. Customers always dial the same number, and the company decides, behind the scenes, who picks up. The health probe is the duty roster, telling the load balancer which manager is currently on shift.

Real-world example: clustered databases

An SAP landscape and many SQL Server clusters use an internal Standard load balancer with floating IP. A health probe on a special port is answered only by the machine that currently owns the service. When a failover happens, the old primary stops answering the probe, the new primary starts, and within seconds traffic follows to the new machine without clients changing anything.

i
Tip

With floating IP, test your probe carefully. A probe that answers on every server, including the standby, will send traffic to the wrong machine and break the cluster.

11High Availability, Zones, and Failure Scenarios

Reliable systems are built by assuming something will break and planning what happens next.

Azure Load Balancer’s Standard SKU carries an availability target of 99.99 percent when you have at least two healthy backend instances. That figure allows only about fifty-two minutes of downtime in a year. Reaching it in your own system depends on your design, not just on the load balancer, because a perfect load balancer in front of a single server is still a single point of failure.

Zones are the core tool. A zone-redundant load balancer keeps working even if one entire zone fails, because its frontend lives in all zones at once. If you spread your backend servers across at least two zones as well, the loss of a zone removes only a share of the servers, and the health probes quickly mark them unhealthy. The survivors carry the load. Remember to leave spare capacity: if you have three zones and lose one, the other two must absorb the extra work.

Failure scenarios and recovery

A

One server crashes

Probes fail, the server is removed from rotation, and new connections go to the others. Only connections already on that server are lost.

B

One zone goes down

A zone-redundant frontend keeps answering. Servers in the lost zone fail probes. Servers in other zones continue.

C

A bad deployment breaks every server

All probes fail, so no healthy target exists. Existing TCP flows end. This is why you roll out changes gradually.

D

Outbound ports run out

New outgoing connections fail while inbound traffic is fine. Fix with NAT Gateway and connection reuse.

E

An entire region fails

A regional load balancer cannot help. A global tier load balancer or DNS based traffic manager in front can send users to another region.

Notice that a failing probe can also cause trouble when it is too touchy. If the probe has a very short interval and a threshold of one failure, a brief hiccup could remove a healthy server, and then the remaining servers get even more traffic and may fail too. This domino effect is why thresholds should allow for small blips.

i
Tip

Run a failure drill. Stop one server, then stop a whole zone’s worth of servers in a test environment, and watch how traffic and probes behave. Recovery plans that were never rehearsed are only hopes.

12The Global Tier: Cross-Region Load Balancing

When your users are spread around the world, one region is not enough.

A regional load balancer lives in one region. If that region has trouble, or if your users are far away and experience slow connections, you need another layer above it. The global tier of Azure Load Balancer, also called the cross-region load balancer, does this. It sits in front of several regional Standard public load balancers, in different parts of the world, and spreads traffic among them.

It gives you a single anycast public address. Anycast is a clever network trick where the same address is announced from many places, and each user’s traffic is routed to the nearest one. Traffic enters Microsoft’s global network close to the user, and from there the global load balancer chooses a regional backend, usually the one geographically closest to the user, and falls back to others if the closest is unhealthy. Because it works at Layer 4, it keeps the original client IP and supports any TCP or UDP service, not just web traffic.

flowchart TB
    U1["Users in Europe"] --> G["Global load balancer - one anycast IP"]
    U2["Users in Asia"] --> G
    U3["Users in America"] --> G
    G -->|"closest and healthy"| R1["Regional LB - West Europe"]
    G --> R2["Regional LB - Southeast Asia"]
    G --> R3["Regional LB - East US"]
    R1 --> A1["Servers in Europe"]
    R2 --> A2["Servers in Asia"]
    R3 --> A3["Servers in America"]
    
Figure 4. One global address fans out to the nearest healthy regional load balancer.
Analogy

A global load balancer is like an international airline’s single phone number. Wherever you call from, the call is quickly passed to the nearest local call center. If the nearest center is closed because of a storm, the call quietly goes to the next closest one.

Benefit

One address worldwide

Clients never need to know which region serves them.

Benefit

Regional failover

If a region’s load balancer becomes unhealthy, traffic moves to the others within moments.

Benefit

Client IP preserved

Backend servers still see the true client address.

Limit

Regional backends only

Its members are regional Standard public load balancers, and it is offered in selected home regions. Check current availability.

!
Warning

The global tier is still Layer 4. It cannot route by web path, cache content, or protect against web attacks. For web applications that need those features, a global Layer 7 service like Azure Front Door is a better fit.

13Gateway Load Balancer

A special version made for security and inspection appliances.

Many companies insert security tools in the path of traffic: firewalls that block attacks, systems that inspect packets for threats, or tools that record traffic for audits. These tools usually come as network virtual appliances, ready-made virtual machines from security vendors. Wiring them into the path of your servers, scaling them, and keeping them highly available used to take a lot of routing work.

The Gateway Load Balancer makes this simple, using what is sometimes called a bump in the wire design. You place the appliances behind a Gateway Load Balancer. Then you chain it to the frontend of a public load balancer or to the network card of a virtual machine. From then on, traffic headed to those resources is first sent through the appliances, inspected, and sent onward, without changing the original source or destination addresses and without changing your routing tables. Packets travel to the appliances wrapped in a tunneling format named VXLAN, which is like putting a letter inside another envelope so it can be delivered across a network and unwrapped on arrival.

1

Deploy the appliances

Place several firewall or inspection virtual machines in a Gateway Load Balancer backend pool.

2

Chain it to your frontend

Link a public load balancer frontend, or a virtual machine, to the gateway load balancer.

3

Traffic detours through inspection

Packets are wrapped, sent to an appliance, inspected, and returned.

4

Scale and heal automatically

Health probes and the pool handle appliance failures and growth.

Analogy

It is like an airport security checkpoint built into the hallway to the gates. Everyone walking to the gate passes through the checkpoint without changing their route or ticket. If one scanner breaks, the other lanes keep working, and more lanes can be opened when queues grow.

Everyday example: a shared firewall for many applications

A company has twenty small applications in different networks. Rather than building firewall routes in each network, the security team runs one pool of inspection appliances behind a Gateway Load Balancer. Each application simply chains to it, and all the inspected traffic keeps its original addresses.

14Security

A front door must be strong. Here is how the load balancer helps keep it that way.

The most important security trait of the Standard SKU is secure by default. A new Standard load balancer, and the public addresses behind it, will not let inbound traffic through until a network security group explicitly allows it. A network security group is a list of allow and deny rules attached to a subnet or a network card. This approach is called default deny, and it prevents accidental exposure of servers.

Because the load balancer does not open or change your traffic, it does not inspect for attacks, and it does not remove encryption. Data stays encrypted end to end if your servers use TLS. Protection against floods of fake traffic comes from Azure DDoS Protection, an add-on service that detects and absorbs huge attacks aimed at public addresses. For deeper checks, many designs combine the load balancer with Azure Firewall, a Web Application Firewall on Application Gateway, or appliances behind a Gateway Load Balancer.

Default

Closed until allowed

Standard SKU needs an explicit network security group rule for inbound traffic.

Probe access

Allow the platform address

Allow health probe traffic from the Azure platform source so servers are not wrongly marked down.

Attacks

DDoS Protection

Absorbs volumetric floods aimed at public frontend addresses.

Privacy

Prefer internal where possible

Keep middle and data tiers behind private frontends with no internet path.

Access

Role based access control

Limit who can change rules, probes, and pools, since small edits can cause outages.

Audit

Activity log and policy

Record every change and enforce company rules with Azure Policy.

Analogy

The load balancer is the lobby of a building. The default-deny rule is a locked front door that opens only for people on the guest list, and the network security group is the guest list. DDoS protection is the crowd control that handles a mob outside, while a firewall or web application firewall is a guard who actually checks bags.

i
Tip

Use resource locks and tight roles on production load balancers. A single wrong click on a rule or a probe path can take an entire service offline.

15Monitoring, Logging, and Metrics

You cannot fix what you cannot see. Azure gives you the numbers.

The main tool is Azure Monitor, the central place for numbers, charts, and alerts in Azure. A metric is a measurement taken over time. Standard Load Balancer publishes many of them, and a few are especially valuable. Data path availability tells you whether the load balancer’s frontend is answering test traffic. Health probe status shows how many backend servers currently pass their probes. SYN count counts new connection attempts, showing how busy you are. SNAT connection count and used SNAT ports warn you before outbound slots run out. Byte and packet counts show how much data flows.

A useful view called Insights draws a live map of your load balancer, its pools, and the health of each part, so a quick glance shows which server is red. Resource Health tells you whether Azure itself sees a platform problem. The Activity Log records every management action such as who changed a rule and when. For deeper analysis you can send metrics to a Log Analytics workspace, a searchable store, and build alerts and dashboards.

What to watchWhy it mattersTypical action
Data path availabilityShows if the frontend is reachable at allAlert immediately if it drops
Health probe statusShows how many servers can receive trafficAlert when healthy count falls below a safe minimum
SYN countReveals traffic spikes or attacksCheck for scaling needs or abuse
Used SNAT portsWarns before outbound failuresAdd NAT Gateway or reuse connections
Byte and packet countsShows capacity trendsPlan growth and spot odd patterns
Activity log changesExplains sudden behavior shiftsReview who changed what

Everyday example: the mysterious timeouts

An app team reports random failures calling a partner service every afternoon. Metrics show used SNAT ports climbing to the limit at exactly that hour. The fix is not a bigger server, but a NAT Gateway and reusing connections, after which the failures disappear.

16Cost, Limits, and Capacity

Load balancers are cheap compared with most Azure services, but knowing how the bill works prevents surprises.

Standard Load Balancer is billed mainly in two ways. First, there is an hourly charge related to the number of rules you configure, with a small number of rules included in the base price. Second, there is a charge for the amount of data processed through the load balancer, measured in gigabytes. Public IP addresses are billed separately, and so are services you add around it, such as NAT Gateway, DDoS Protection, and the global tier. Always check the current price list, since rates and included amounts change.

Because the load balancer is distributed and managed, you do not size it like a virtual machine. There is no instance size to pick and no warm-up period. It scales with the underlying Azure network. What you do plan for are limits: the maximum number of rules, frontends, and backend instances per load balancer, and the quotas on public addresses in your subscription. These numbers are large and rarely block normal designs, but very big architectures should check them early.

Cost leverHow to control it
Rule countCombine services sensibly. Use HA ports where one rule can replace many.
Data processedAvoid sending needless traffic through the load balancer. Keep chatty internal traffic inside a tier when possible.
Public IPsUse only as many frontends as you truly need and remove unused ones.
Outbound designCompare NAT Gateway costs against the risk and cost of SNAT failures.
Global tierUse it only when you truly need multi-region reach at Layer 4.
i
Tip

The load balancer is usually a small part of the total bill. The real cost saver is using it to let you run fewer, better-used servers, scaling them out and in as demand changes.

17Advantages, Disadvantages, and Trade-offs

No tool is right for everything. A fair look at both sides helps you choose well.

Advantages

  • Fully managed, with no machines to patch, size, or restart.
  • Very fast and low delay, since it forwards packets without opening them.
  • Works with any TCP or UDP service, not only web traffic.
  • Keeps the real client IP address visible to your servers.
  • Zone-redundant design with a 99.99 percent availability target.
  • Secure by default with the Standard SKU.
  • Supports both public and private designs, plus global and gateway variants.
  • Billing is modest and tied to rules and data processed.

Disadvantages

  • No web awareness: no path routing, cookie stickiness, caching, or TLS offload.
  • Distribution is by hash, not by actual server load, so very uneven requests can unbalance servers.
  • Outbound SNAT needs careful design to avoid port exhaustion.
  • Backend servers cannot call the frontend of their own internal load balancer.
  • A regional load balancer cannot survive the loss of its own region without extra layers.
  • Limited built-in traffic inspection or attack filtering.

The big trade-offs

Speed versus smarts. Layer 4 is quick and simple because it does not read your traffic. Layer 7 services are smarter but add processing and cost. Even spread versus stickiness. The default hash spreads connections nicely, while affinity keeps users on one server but can concentrate load, especially when many users share one network address through a corporate gateway. Simplicity versus control. Default settings are easy, while custom probes, rules, and outbound plans give precision but create more things to maintain. Regional versus global. A regional load balancer is simple and local, while the global tier adds reach and region-level failover at extra cost and complexity.

18Design Patterns and Choosing the Right Balancer

Proven recipes, and a simple guide for picking among Azure’s four load balancing choices.

Azure offers several traffic distribution services, and beginners often mix them up. Two questions sort them out. First, is the traffic web (HTTP and HTTPS) or anything else? Second, do you need distribution within a region or across the world?

ServiceLayerScopeBest for
Azure Load BalancerLayer 4, TCP and UDPRegional, with a global tierNon-web traffic, databases, high speed, any protocol
Application GatewayLayer 7, HTTP and HTTPSRegionalWeb apps needing path routing, TLS offload, web firewall
Azure Front DoorLayer 7, HTTP and HTTPSGlobalWorldwide websites needing acceleration, caching, failover
Traffic ManagerDNS basedGlobalSteering users to endpoints by name lookup, any protocol
Analogy

Traffic Manager is a road sign that tells drivers which city to head for. Front Door is a smart toll plaza network on the highways with its own fast lanes. Application Gateway is a concierge in a hotel lobby who reads each guest’s request and sends them to the right department. Azure Load Balancer is the fast, silent doorman who simply opens whichever door is free.

Pattern: the layered three-tier application

A classic design places a public entry service in front of the web tier, then an internal load balancer between the web tier and the application tier, and another internal load balancer in front of the data tier. Each tier scales on its own, each is spread across zones, and only the very first layer is exposed to the internet.

flowchart TB
    U["Users"] --> FD["Public entry - Front Door or Application Gateway"]
    FD --> W["Web tier servers"]
    W --> ILB1["Internal load balancer"]
    ILB1 --> APP["Application tier servers"]
    APP --> ILB2["Internal load balancer with floating IP"]
    ILB2 --> DB["Database cluster"]
    NSG["Network security groups on each tier"] -.-> W
    NSG -.-> APP
    NSG -.-> DB
    
Figure 5. A three-tier design where each layer has its own balancer and only the first layer is public.
Pattern

Zone-redundant everything

Zone-redundant frontends with backend servers spread across all zones.

Pattern

Private first

Use internal load balancers for every tier that does not need internet exposure.

Pattern

Appliance scale-out

Firewalls behind HA ports or a Gateway Load Balancer, instead of a single device.

Pattern

Cluster listener

Floating IP and a precise probe to point clients at the active database node.

Pattern

Explicit outbound

NAT Gateway for outbound, load balancer only for inbound.

Pattern

Global fan-out

Global tier over regional load balancers for non-web services with worldwide users.

Kubernetes pattern

Azure Kubernetes Service uses Azure Load Balancer behind the scenes. When a developer creates a service of the load balancer type, AKS automatically adds a rule and a frontend address on the cluster’s load balancer. The same piece also provides outbound access for the cluster’s nodes, which is why outbound design matters here as well.

19Anti-Patterns to Avoid

An anti-pattern is a habit that looks sensible but leads to pain.

ANTI-PATTERN 01Avoid
What people do

Put one server behind the load balancer and call the design highly available.

Why it hurts

The load balancer is not the weak spot. The single server is. The 99.99 percent target also assumes at least two healthy backend instances.

Better approach

Run at least two servers, preferably in different zones, with spare capacity for failures.

ANTI-PATTERN 02Avoid
What people do

Use a heavy application page as the health probe path.

Why it hurts

Probes add load and fail during busy moments, removing healthy servers and starting a chain reaction of overload.

Better approach

Use a light dedicated health page that checks only what matters, with a sensible threshold.

ANTI-PATTERN 03Avoid
What people do

Ignore outbound connectivity until production errors appear.

Why it hurts

SNAT port exhaustion produces random, hard-to-trace failures when calling external services.

Better approach

Plan outbound on day one, with NAT Gateway and connection reuse in clients.

ANTI-PATTERN 04Avoid
What people do

Block the platform probe address in network security groups or server firewalls.

Why it hurts

Every server appears dead, so the load balancer sends traffic nowhere and the whole service looks down.

Better approach

Allow health probe traffic from the Azure platform source in both the group rules and the servers’ own firewalls.

ANTI-PATTERN 05Avoid
What people do

Use source IP affinity to hide an application that stores user sessions in server memory.

Why it hurts

Users behind one shared corporate address all land on one server, and a server failure loses their sessions.

Better approach

Keep sessions in a shared store such as a cache or database so any server can answer any request.

ANTI-PATTERN 06Avoid
What people do

Expect the load balancer to do web tasks such as reading URLs or removing TLS.

Why it hurts

It cannot, so teams build awkward workarounds on each server.

Better approach

Place a Layer 7 service, such as Application Gateway or Front Door, in front when you need web features.

20Best Practices and Common Mistakes

A short checklist that separates calm operations from late-night emergencies.

1

Choose Standard and zone-redundant

Start with the Standard SKU and a zone-redundant frontend, and spread servers across zones.

2

Write good probes

Use light, dedicated health checks with a threshold that tolerates small blips.

3

Open the network on purpose

Create network security group rules for traffic and for the platform probe address.

4

Design outbound separately

Use NAT Gateway for outgoing traffic and track SNAT metrics.

5

Make servers stateless

Keep session data in a shared store so any server can handle any request.

6

Set idle timeouts deliberately

Match the timeout and TCP keepalives to how long your connections stay quiet.

7

Alert and rehearse

Alert on data path availability and healthy server count, and practice failures before they happen.

8

Automate and lock down

Define everything as code, restrict who can edit, and use locks on production.

Common mistakes

  • Mixing editions. Resources of different SKUs cannot be combined, so plan the whole design on Standard.
  • Forgetting the network security group. A new Standard load balancer rejects inbound traffic until allowed.
  • Letting probes and rules disagree. A probe on one port while the application listens on another marks every server unhealthy.
  • Calling the internal frontend from a backend member. The call fails because of the return path problem.
  • Ignoring idle timeouts. Long quiet connections break, and users see strange hangs.
  • Treating the balancer as a firewall. It spreads traffic, it does not inspect it.
!
Warning

Changing a probe, a rule, or a backend pool on a production load balancer takes effect quickly. Test changes in a copy of the environment first, and apply them in a quiet period with a rollback plan.

21Real-World Usage Patterns

Where does Azure Load Balancer shine in practice?

Web and API farms

Teams running many identical web servers or application programming interface servers place them behind a public load balancer, often after a Layer 7 service. The load balancer’s job is fast, simple connection distribution with real client addresses preserved.

Clustered databases and SAP landscapes

SQL Server Always On and SAP high availability setups use an internal Standard load balancer with floating IP so that one stable address always leads to the active node. This pattern is documented by Microsoft for such clusters.

Network virtual appliances

Companies place virtual firewalls from security vendors behind an internal load balancer with HA ports, or behind a Gateway Load Balancer, so inspection scales out and survives failures.

Gaming, streaming, and real-time services

Game servers and media services use UDP and custom TCP protocols that web-focused services do not handle. A Layer 4 balancer distributes these connections with very low delay, and the global tier can send players to the nearest region.

Kubernetes clusters

Azure Kubernetes Service creates load balancer rules automatically for services exposed to the outside, and uses the same component for outbound traffic from the nodes.

Private Link services

A company that wants to offer a service privately to other Azure customers places it behind a Standard internal load balancer and exposes it through Private Link, so customers reach it without any internet path.

Use the simple, fast Layer 4 balancer for the heavy lifting, and add smarter layers only where the traffic truly needs them.

22Frequently Asked Questions

Q1Is Azure Load Balancer a virtual machine I need to manage?

No. It is a managed, distributed, software-defined service built into the Azure network. There is nothing to patch, size, or restart.

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

Load Balancer works at Layer 4 and handles any TCP or UDP traffic quickly without reading it. Application Gateway works at Layer 7, understands web requests, and can route by path, remove TLS, and apply a web application firewall.

Q3Does the load balancer terminate TLS or encryption?

No. Encrypted traffic passes straight through to your servers, which hold the certificates.

Q4Do my servers see the real client IP?

Yes. Because the load balancer forwards packets instead of acting as a proxy, the real client address is preserved.

Q5What happened to the Basic SKU?

It was retired in September 2025. New and existing designs should use the Standard SKU, which is zone-aware and secure by default.

Q6Why does my new load balancer not let any traffic through?

Standard is secure by default. You must allow the traffic with a network security group, and also allow health probe traffic from the Azure platform.

Q7How does it choose which server gets a connection?

By default it hashes the source address, source port, destination address, destination port, and protocol, and maps the result to a healthy server. It does not measure each server’s current load.

Q8How do I keep a user on the same server?

Use source IP affinity in the rule. It keeps connections from the same client address on the same server, although stateless designs are usually better.

Q9What is SNAT port exhaustion?

It happens when outgoing connections use up all available port slots on the public address. New outgoing connections then fail. Use NAT Gateway, reuse connections, and watch SNAT metrics.

Q10Can it balance traffic across regions?

Yes, with the global tier, which sits in front of regional Standard public load balancers and gives one anycast address with regional failover.

Q11When do I need a Gateway Load Balancer?

When you want to insert scalable and highly available security or inspection appliances into the path of traffic without changing addresses or building complex routing.

Q12Why can a server not reach its own internal load balancer frontend?

The reply would return to the same machine that sent the request, so the network cannot match it to a connection. Call the frontend from a different machine or tier.

23Summary and Key Takeaways

Key Takeaways

  • What it is: Azure Load Balancer is a managed Layer 4 service that spreads TCP and UDP connections across healthy servers, with no machines for you to run.
  • How it is built: A frontend IP, a backend pool, health probes, and load balancing rules, plus inbound NAT and outbound rules for special cases.
  • How it decides: It hashes the five values of a connection to pick a server, forwards packets without opening them, and keeps the real client address.
  • How it stays healthy: Light, well-tuned probes remove failing servers, and zone-redundant frontends with servers across zones give a 99.99 percent target.
  • Where people get hurt: Missing network security group rules, blocked probe traffic, heavy probe pages, SNAT port exhaustion, and expecting web features it does not have.
  • Which variant to use: Regional for one region, Global for many regions at Layer 4, and Gateway for scalable security appliances. Pair with Application Gateway or Front Door for web needs.
  • How to run it well: Start with Standard, design outbound with NAT Gateway, keep servers stateless, monitor data path availability and healthy counts, and rehearse failures.