Azure Load Balancer: The Traffic Police of Your Cloud Applications

Azure Load Balancer: The Traffic Police of Your Cloud Applications

A beginner-friendly guide to Azure Load Balancer: what it does, how its parts fit together, how it checks server health, how it handles inbound and outbound traffic, and how to choose it over other Azure traffic services.

Picture a busy railway station with ten ticket counters. If every traveler rushed to the first counter, one clerk would be buried in work while nine others sat idle, and the queue would stretch out of the door. Now imagine a friendly guide at the entrance who looks at all ten counters, sees which ones are open and which have shorter lines, and points each new traveler to a suitable counter. Everyone is served faster, no clerk is overworked, and if one counter closes for a break, the guide simply stops sending people there. In the cloud, that guide is called a load balancer, and Azure Load Balancer is Microsoft’s version of it.

In this guide, we will learn Azure Load Balancer from the very beginning. You do not need any earlier knowledge of networking. Each new word will be explained when it first appears, with a simple comparison from daily life. By the end, you will understand how the service works, what each of its parts does, and how to pick the right options for a real application.

1What Is Azure Load Balancer?

Azure Load Balancer spreads incoming network traffic across several servers so that no single server is overwhelmed.

Let us start with a few basic words. Azure is Microsoft’s cloud platform, a large collection of computers in data centers that you can rent whenever you need them. A server is simply a computer that answers requests from other computers, for example a computer that sends a web page to your browser. A virtual machine, or VM, is a server that exists as software on one of Microsoft’s big machines. Traffic is the stream of messages that travels across a network between a user and a server.

One server can only handle a limited number of users at once. If your website becomes popular, a single server will slow down or even crash. The usual answer is to run several identical servers and share the work between them. But then a new question appears: how does a user’s request know which server to visit? That is exactly the job of a load balancer. It sits in front of the servers, receives all the requests, and passes each one to a healthy server.

Azure Load Balancer works at what experts call Layer 4 of the network model. That means it looks at basic delivery details such as the address, the port number and the type of connection (TCP or UDP), but it does not read the content of the message itself. Because it does not open the message, it is extremely fast and can handle millions of requests per second with very low delay.

Simple Analogy

Think of a postal sorting office that reads only the address on the envelope and never opens the letter. It can sort enormous amounts of mail quickly because it does not care what is inside. Azure Load Balancer behaves in the same way: it reads the delivery details and forwards the traffic, without looking at the message content.

Layer 4
works with TCP and UDP traffic
Millions
of flows per second with low delay
99.99%
availability target for the Standard SKU with healthy instances

2Why We Need Load Balancing

Load balancing solves three problems at once: too much traffic, server failure, and growth.

Before we study the details, let us see why this service matters. Without a load balancer, an application running on a single server has several weaknesses.

Problem 1

Overload

One server receiving all requests can run out of power and become slow for every user.

Problem 2

Single point of failure

If that one server stops working, the whole application disappears until someone repairs it.

Problem 3

Hard to grow

Adding a second server does not help unless something decides how to share users between the two.

Problem 4

Hard maintenance

Updating a single server means taking the application offline, which annoys customers.

A load balancer answers all four problems. It shares requests across many servers, which reduces overload. It checks the health of every server and stops sending traffic to a broken one, which removes the single point of failure. It lets you add more servers when demand grows, and it lets you update servers one at a time while the others keep serving users.

Simple Analogy

A supermarket with one checkout lane has long queues and closes completely if the cashier falls ill. A supermarket with six lanes and a floor manager directing customers to open lanes keeps working smoothly, even when one cashier goes for lunch.

i
Two Key Words

Remember scalability, which means the ability to handle more users by adding more servers, and availability, which means the application stays reachable even when something breaks. A load balancer improves both.

3Public and Internal Load Balancers

The first big choice is whether the load balancer faces the internet or stays inside your private network.

Azure Load Balancer comes in two main types, depending on who needs to reach your servers.

Public load balancer

It has a public IP address that anyone on the internet can reach. It receives requests from outside users and forwards them to servers in your private network. It also gives your private servers a way to reach the internet for outbound connections. It is used for websites and public services.

Internal (private) load balancer

It has only a private IP address inside your virtual network, so it cannot be reached from the public internet. It spreads traffic among servers that are used only by other servers, such as the application tier or database tier of a multi-layer system.

An IP address is the numeric address that identifies a device on a network, a little like a house number. A virtual network, often called a VNet, is your own private network inside Azure, isolated from other customers. A public IP can be reached from the internet, while a private IP exists only inside your VNet.

Simple Analogy

A public load balancer is like the front reception desk of a company that welcomes visitors from the street. An internal load balancer is like the internal mailroom that passes work between departments. Visitors from outside never meet the mailroom directly.

i
Many Systems Use Both

A common design places a public load balancer in front of the web servers and an internal load balancer in front of the application servers. We will draw this design later in the guide.

4The Building Blocks of Azure Load Balancer

A load balancer is made of a few simple parts that work together.

To understand how traffic flows, you must know the main components. Each one has a clear and simple role.

Part 1

Frontend IP configuration

The address that users connect to. It can be a public IP or a private IP, and one load balancer can have several.

Part 2

Backend pool

The group of servers that actually answer requests. These can be VMs or the instances of a scale set.

Part 3

Health probe

A regular check that asks each server whether it is alive and ready to work.

Part 4

Load balancing rule

The instruction that links a frontend address and port to the backend pool and a health probe.

Part 5

Inbound NAT rule

Forwards traffic from a specific frontend port to one particular server, for example for management access.

Part 6

Outbound rule

Controls how servers in the backend pool reach the internet and how many connections they may open.

flowchart LR
    U["Users on the internet"] --> F["Frontend IP configuration"]
    F --> R["Load balancing rule"]
    R --> P["Backend pool"]
    H["Health probe"] -. "checks each server" .-> P
    P --> V1["Server 1"]
    P --> V2["Server 2"]
    P --> V3["Server 3"]
        
FIG 1 — The main components of Azure Load Balancer and how they connect

Read the diagram from left to right. Users reach the frontend address. The load balancing rule says, “traffic arriving here should go to this backend pool.” The health probe quietly checks the servers in the background, and only healthy servers receive traffic.

5The Frontend and the Backend Pool in Detail

The frontend is the single door; the backend pool is the room full of workers behind it.

Frontend IP configuration

Users never need to know the address of any individual server. They only know the frontend IP, or a name that points to it. This is very helpful: you can add servers, remove servers, or replace them completely, and the users keep using the same address. A load balancer can hold more than one frontend IP, so a single set of servers can serve several websites or services at once.

Backend pool

The backend pool is the list of targets that receive the traffic. You can add servers to the pool by their network interface or by their IP address. Typical members are individual VMs, VMs in an availability set, or the many identical VMs that make up a virtual machine scale set, which is a group of VMs that Azure can grow and shrink automatically. When a scale set adds a new VM, that VM can join the backend pool automatically, so traffic reaches it without any manual work.

Simple Analogy

The frontend is the single phone number printed on a company’s advertisement. The backend pool is the team of customer-care agents who answer those calls. Callers always dial the same number, and the phone system quietly decides which free agent picks up.

Example: a store’s website during a sale

An online store normally runs on three web servers. Before a big sale, the team grows the scale set to ten servers. The new servers join the backend pool automatically. Customers keep using the same website address and never notice the change, but the load is now shared by ten servers instead of three.

!
Common Mistake

Putting servers with different roles in the same backend pool. All members of a pool should be able to answer the same kind of request, otherwise some users will receive errors.

6Health Probes: Checking Who Is Alive

A health probe is a regular check that lets the load balancer avoid sending traffic to broken servers.

A load balancer that blindly sent requests to a crashed server would be worse than useless. To avoid this, Azure uses health probes. A probe is a tiny test message that the platform sends to each server in the backend pool at regular intervals. If a server answers correctly, it is marked healthy. If it fails to answer several times in a row, it is marked unhealthy, and the load balancer stops sending new connections to it. When the server recovers and answers again, it is added back automatically.

1

TCP probe

The simplest type. The probe tries to open a connection on a chosen port. If the connection succeeds, the server is healthy. It checks that the port is open, but not that the application behind it is actually working well.

2

HTTP probe

The probe requests a specific web path and expects a successful reply. This is a better test for websites, because a server can have an open port while the application behind it is broken.

3

HTTPS probe

Works like an HTTP probe but over an encrypted connection, for applications that must be reached securely.

You choose how often the probe runs and how many failures in a row mark a server as unhealthy. A shorter interval detects failures sooner, but creates a little more checking traffic. A longer interval is calmer, but a broken server may keep receiving requests for a few seconds longer.

Simple Analogy

A health probe is like a teacher calling roll at the start of each lesson. A student who answers “present” stays on the list. A student who stays silent several times is marked absent, and the teacher stops giving them work until they are back.

i
Use a Meaningful Health Page

For websites, create a small health page in your application that checks its own database connection and other needs, and point the HTTP probe at it. That way a server that is running but cannot reach its database is taken out of rotation.

!
Common Mistake

Blocking the probe by accident with a firewall or security rule. Health probes come from a special Azure address, and if your network security rules block it, every server will look unhealthy and the whole application will appear to be down.

7Load Balancing Rules and Distribution Modes

The rule decides which traffic goes where, and the distribution mode decides how users are matched to servers.

A load balancing rule connects the front door to the room behind it. A typical rule says, “Any traffic arriving at this frontend IP on port 443 should be sent to port 443 of the servers in this backend pool, using this health probe.” You can create several rules on the same load balancer for different ports and services.

How does it pick a server?

By default, Azure Load Balancer uses a method that looks at five pieces of information about each connection: the source address, the source port, the destination address, the destination port, and the protocol. These five values are combined into a number, and that number decides which server receives the connection. This is called a five-tuple hash. Because the source port changes with every new connection, the same user’s different connections may reach different servers, which spreads the load evenly.

Session persistence

Sometimes you want the same user to keep returning to the same server, for example when the server remembers a shopping basket in its own memory. Azure Load Balancer supports source IP affinity, also called session persistence. In this mode, only the user’s address, or the address and protocol, is used to pick the server, so the same user is sent to the same server as long as it stays healthy and in the pool.

ModeWhat Is Used to Pick a ServerBest For
Default (five-tuple)Source and destination address, ports and protocolStateless servers that share data elsewhere
Source IP affinity (two-tuple)Source and destination addressServers that keep user data in memory
Source IP affinity with protocol (three-tuple)Source and destination address plus protocolCases needing persistence per protocol
i
Prefer Stateless Design

Whenever possible, keep user data in a shared place such as a database or cache instead of in a single server’s memory. Then any server can serve any user, and you rarely need session persistence at all.

!
Persistence Has a Catch

Many users behind one office network share one public address. With source IP affinity, all of them may land on the same server, which can make the load uneven.

8How a Request Travels Through the Load Balancer

Following one request from start to finish makes the whole system easy to picture.

Suppose a customer opens your store’s website. Their browser connects to your public frontend address. The load balancer receives the connection, looks at the five details we described, and picks a healthy server from the backend pool. It then forwards the traffic to that server. The reply from the server travels back to the customer along the same flow.

An important feature of Azure Load Balancer is that it is not a proxy. A proxy is a middleman that takes a request, makes a fresh request of its own, and then relays the answer. Azure Load Balancer does not do this. It forwards the original connection, so the server can see the real address of the user. This keeps delay low and makes the setup simple. It also means that the load balancer does not read, change or cache the content.

sequenceDiagram
    participant C as Customer
    participant LB as Load Balancer
    participant S1 as Server 1
    participant S2 as Server 2
    LB->>S1: Health probe
    S1-->>LB: Healthy
    LB->>S2: Health probe
    S2--xLB: No answer
    C->>LB: Open connection to frontend
    LB->>S1: Forward to a healthy server
    S1-->>C: Reply
        
FIG 2 — A request reaching only the healthy server after a failed probe

In the diagram, the probe to Server 2 gets no answer, so the load balancer marks it unhealthy and sends the customer to Server 1. Nothing else needs to happen. When Server 2 returns to health, the next probes will succeed and it will rejoin automatically.

i
What About Existing Connections?

When a server is marked unhealthy, new connections stop going to it. Some existing connections may still be affected, depending on the protocol and the situation, so applications should be written to reconnect gracefully when a connection drops.

9SKUs and Tiers: Standard, Gateway and Global

Azure sells load balancers in different flavors, and today the Standard SKU is the one to use.

A SKU is simply a product version with its own features and price. Azure Load Balancer has had more than one over the years, and it is important to know what is current.

Retired

Basic SKU

The older, limited version. Microsoft has retired it, so new designs should not use it, and any remaining ones should be upgraded.

Current

Standard SKU

The main choice today. It supports availability zones, larger backend pools, richer monitoring and a service level agreement.

Special

Gateway SKU

Used to chain third-party network appliances, such as firewalls, into the traffic path without changing your applications.

Regional and global tiers

Apart from the SKU, there are two tiers. A regional load balancer works inside one Azure region, which is a geographic area with Azure data centers. A global load balancer, also called a cross-region load balancer, sits in front of several regional load balancers and gives you a single worldwide address. It sends each user to the closest healthy region, and if a whole region has problems, traffic moves to another one.

FeatureStandard (Regional)Global (Cross-region)
ScopeOne regionMultiple regions
Frontend addressRegional IPOne global address
Main purposeShare load among serversShare load among regions
Failure protectionServer and zone failuresWhole region failures
!
Check Retirement Notices

Azure retires older features over time. If you inherit an old environment that still uses the Basic SKU, plan an upgrade instead of waiting, and always check the official documentation for the latest status.

10Availability Zones and Resilience

Zones let your load balancer and servers survive the loss of an entire data center building.

An availability zone is a physically separate location inside an Azure region, with its own power, cooling and networking. A region with zones has at least three of them. If one building loses power, the other two keep running.

A Standard load balancer can be made zone-redundant. In this setup, the frontend address is served from all zones at the same time, so if one zone fails, the frontend stays available through the remaining zones. You can also make a frontend zonal, which ties it to one chosen zone. This is useful when you want to keep traffic inside a single zone for the lowest delay, but it gives no protection against the loss of that zone.

Zone-redundant design

Web servers are spread evenly over three zones and sit behind a zone-redundant frontend. If a zone goes down, one third of the servers disappear, but the frontend and the other two thirds keep serving users with no change to the address.

Zonal design

A team places a database cluster and its internal load balancer in the same zone to keep delay very low, and builds a second copy in another zone for protection.

Simple Analogy

Zones are like having branches of your shop in three different parts of a city, each with its own electricity. A power cut in one neighborhood closes only one branch. A zone-redundant frontend is like a single phone number that rings in all three branches at once.

i
Spread the Backend Too

A zone-redundant frontend alone does not save you if all your servers sit in one zone. Spread the backend servers across zones as well.

11Inbound NAT Rules and Port Forwarding

Sometimes you need to reach one particular server instead of any server in the pool.

The load balancing rules we studied pick any healthy server. But administrators sometimes need to connect to one exact machine, for example to repair it. NAT stands for Network Address Translation, a technique that rewrites the destination of traffic. An inbound NAT rule says, “Traffic arriving at this frontend on port 50001 should go to Server 1 only, on its management port.” Another rule can send port 50002 to Server 2.

Simple Analogy

A company’s main phone number is answered by whichever agent is free, but each agent also has a direct extension. An inbound NAT rule is like giving each server its own extension on the same phone system.

!
Security Warning

Exposing management ports such as remote desktop or secure shell directly to the internet is risky, because attackers constantly scan for them. Prefer a safer approach such as Azure Bastion or a private connection, and use inbound NAT rules for management only when you restrict who can reach them.

i
Good to Know

Inbound NAT rules can be created for a single VM or for a range of ports mapped to a backend pool, which is convenient for scale sets with many instances.

12Outbound Connectivity and SNAT

Load balancers also help private servers reach the internet, and this needs careful planning.

So far we discussed traffic coming in. But servers also need to go out, for example to download updates or call an external service. Servers with only private addresses cannot be reached from the internet, and replies must find their way back. For this, Azure uses SNAT, short for Source Network Address Translation. It replaces the server’s private address with a public one on the way out, and remembers the connection so that the reply returns to the right server.

Each public IP address has a limited number of ports it can use for these outgoing connections. If many servers open many connections to the same destination, the ports can run out, and new outgoing connections fail. This is called SNAT port exhaustion, and it is a classic cause of mysterious connection errors in busy applications.

Simple Analogy

Imagine an office where all employees make outside calls through one shared company phone number with only a limited number of lines. If too many people call at once, some hear a busy tone even though their own phones work perfectly.

Ways to manage outbound traffic

1

NAT Gateway

A dedicated Azure service for outbound connections that provides many ports and is generally the recommended choice for busy workloads.

2

Load balancer outbound rules

You define exactly which public addresses are used and how many ports each server gets, giving you control over the allocation.

3

Public IP on each VM

Gives a server its own ports, but increases cost and the number of public addresses you must protect.

i
Plan Outbound Explicitly

Azure has been moving away from implicit default outbound access for new virtual networks. Choose an explicit outbound method such as a NAT Gateway instead of relying on defaults, and check the current guidance in the official documentation.

13Special Features: HA Ports, Floating IP and Idle Timeout

A few advanced options solve particular problems, and it helps to know what they are for.

Feature

HA Ports

A single rule on an internal Standard load balancer that balances traffic on all ports and protocols at once. Often used with network virtual appliances such as firewalls.

Feature

Floating IP

Also called direct server return. The backend server keeps the frontend address on itself, which some clustered databases need in order to share one address.

Feature

TCP idle timeout

How long a quiet connection is kept open before being dropped. The default is a few minutes, and it can be extended.

Feature

TCP reset on idle

Sends a signal to both sides when an idle connection is dropped, so applications notice at once instead of waiting.

Why idle timeout matters

Many beginners meet idle timeout by surprise. An application opens a connection to a server, then sits quietly for several minutes. The load balancer, seeing no traffic, forgets the connection. When the application finally sends data, the connection no longer exists and an error appears. Two fixes are common: have the application send a tiny keep-alive message now and then, or raise the idle timeout setting within the allowed limit.

Simple Analogy

Idle timeout is like a phone call where the line is cut after several minutes of silence. Either keep talking now and then, or ask the phone company to wait a little longer before hanging up.

i
Keep-Alive Messages

Most database drivers and application frameworks can send keep-alive messages automatically. Turn them on for long-lived connections instead of depending on a long timeout.

14Security: Secure by Default

The Standard load balancer is closed to inbound traffic until you explicitly allow it.

The Standard SKU follows a principle called secure by default. A public Standard load balancer and its public IP do not accept inbound traffic unless a network security group allows it. A network security group, or NSG, is a set of allow and deny rules attached to a subnet or a network interface. This is like a building where every door is locked until you hand out keys.

1

Add an NSG rule for your traffic

Explicitly allow only the ports you really need, such as 443 for secure web traffic, from the sources that should reach it.

2

Allow the health probe

Make sure your rules do not block the Azure probe address, or the load balancer will think every server is down.

3

Add protection against attacks

Use Azure DDoS Protection for public addresses that need defense against floods of fake traffic.

4

Prefer private design where possible

Keep internal tiers behind internal load balancers with no public addresses at all.

!
Common Mistake

Believing that the load balancer filters out malicious content. It works at Layer 4 and does not inspect requests, so it cannot block attacks hidden inside web traffic. For that, add a web application firewall in front.

15Azure Load Balancer Compared with Other Azure Traffic Services

Azure has several traffic services, and choosing between them is one of the most common beginner questions.

Azure Load Balancer is not the only service that distributes traffic. Each of the others works at a different level and solves a different problem.

Layer 4 · Regional

Azure Load Balancer

Fast TCP and UDP distribution inside a region. Does not read web content.

Layer 7 · Regional

Application Gateway

Understands web requests. Can route by URL path, end secure connections and include a web application firewall.

Layer 7 · Global

Azure Front Door

A global web entry point with fast routing, caching and security features, for web applications used worldwide.

DNS · Global

Traffic Manager

Directs users using DNS answers. It points users to an endpoint but does not carry the traffic itself.

QuestionLoad BalancerApplication GatewayFront DoorTraffic Manager
Works atLayer 4Layer 7Layer 7DNS
ScopeRegional (global tier available)RegionalGlobalGlobal
Reads web contentNoYesYesNo
Handles non-web trafficYesMostly webWebAny, by DNS
Built-in web firewallNoOptionalOptionalNo
flowchart TD
    S["What traffic do you have?"] --> Q1{"Web traffic over HTTP or HTTPS?"}
    Q1 -- No --> A["Azure Load Balancer"]
    Q1 -- Yes --> Q2{"Need URL routing or a web firewall?"}
    Q2 -- No --> A
    Q2 -- Yes --> Q3{"Users in many regions?"}
    Q3 -- No --> B["Application Gateway"]
    Q3 -- Yes --> C["Azure Front Door"]
    A --> Q4{"Need DNS-based routing across regions?"}
    Q4 -- Yes --> D["Add Traffic Manager or global load balancer"]
        
FIG 3 — A simple path for choosing among Azure traffic services

Often, these services are combined. A global entry point may send users to the closest region, an Application Gateway may handle web rules there, and an internal Azure Load Balancer may balance traffic between application servers behind it.

16A Typical Multi-Tier Design

Real systems usually combine a public load balancer in front and an internal one in the middle.

Let us see how the pieces combine in a very common design. A multi-tier application splits the system into layers: a web tier that talks to users, an application tier that runs business logic, and a data tier that stores information. Each tier has several servers, and each needs a load balancer in front so that the failure of one server does not stop the layer.

flowchart TD
    U["Users"] --> PLB["Public Load Balancer"]
    PLB --> W1["Web server 1"]
    PLB --> W2["Web server 2"]
    W1 --> ILB["Internal Load Balancer"]
    W2 --> ILB
    ILB --> A1["App server 1"]
    ILB --> A2["App server 2"]
    A1 --> DB["Database tier"]
    A2 --> DB
        
FIG 4 — A public load balancer for the web tier and an internal one for the application tier

Users only ever meet the public load balancer. The web servers talk to the application tier through an internal load balancer, which has no public address. The database tier is not reachable from the internet at all. This layered layout reduces the number of exposed doors and lets each tier grow or shrink on its own.

Example: an online booking system

A travel booking company runs three web servers behind a public load balancer. Behind them, four application servers handle searches and payments through an internal load balancer. During holiday season, only the application tier is grown, because the web tier is not the bottleneck. This saves money while keeping bookings fast.

17Monitoring and Troubleshooting

A handful of metrics tell you whether the load balancer and its servers are healthy.

Azure Monitor collects numbers from your load balancer, called metrics. You can display them on charts and set alerts when they cross a limit. Standard load balancers provide a rich set of metrics.

Metric

Data path availability

Shows whether traffic can travel through the load balancer to the backend. A drop means users may be unable to connect.

Metric

Health probe status

Shows how many backend servers are healthy. A fall signals broken servers or a blocked probe.

Metric

SNAT connection count

Shows outgoing connections, including failed ones, which helps you spot port exhaustion early.

Metric

Byte and packet counts

Show how much traffic passes through, helping you see growth and unusual spikes.

A simple troubleshooting path

1

Check probe health first

If all servers show unhealthy, look for a blocked probe address, a stopped application or a wrong probe port.

2

Check the network security rules

Confirm that both user traffic and probe traffic are allowed to reach the servers.

3

Check the rules and ports

Make sure the frontend port, backend port and probe port match what the application really listens on.

4

Check outbound problems

If servers fail to reach external services, look at SNAT usage and the outbound method in place.

i
Alert on Probe Status

Create an alert when the number of healthy servers falls below the minimum your application needs. This gives early warning before users are affected.

Every tool has strengths and boundaries, and knowing both leads to better designs.

Advantages

  • Very low delay and very high throughput
  • Handles any TCP or UDP application, not only websites
  • Built-in health checks remove broken servers automatically
  • Zone-redundant frontends survive the loss of a zone
  • Preserves the real client address on forwarded traffic
  • Simple model that works well with scale sets

Disadvantages / Trade-offs

  • Does not read web content, so no URL or header routing
  • Does not end secure connections for you
  • No built-in web application firewall
  • Outbound ports are limited and need planning
  • Health probes need correct network rules to work

The key idea is to match the tool to the job. When you need speed and support for all kinds of traffic, Azure Load Balancer is excellent. When you need to look inside web requests, pair it with or replace it by a Layer 7 service.

19Understanding the Cost

The bill depends mainly on how many rules you have and how much data passes through.

For the Standard SKU, pricing is built from a few parts. There is a charge related to the number of load balancing and outbound rules you configure, and a charge based on the amount of data processed. Public IP addresses used by the load balancer have their own price. Using a NAT Gateway, a cross-region tier, DDoS protection or extra services adds to the total. Exact prices change and differ by region, so always check the official pricing page before estimating a budget.

Saver 1

Combine rules wisely

Avoid creating many rules you do not need; each one can add to the bill.

Saver 2

Use internal balancers privately

Keep internal tiers private so that you need fewer public IP addresses.

Saver 3

Delete unused resources

Remove test load balancers and unattached public IPs that nobody uses.

Saver 4

Right-size the backend

Use scale sets so servers match real demand instead of staying at peak size all day.

i
Tag and Budget

Tag load balancers with project and owner names and set budget alerts in Azure Cost Management, so unexpected costs are spotted quickly.

20Best Practices and Mistakes to Avoid

Habits that experienced teams follow, and traps that beginners often fall into.

1

Use the Standard SKU

Start every new design with Standard, and upgrade any leftover Basic load balancers.

2

Spread servers across zones

Use zone-redundant frontends and place backend servers in several zones for real resilience.

3

Use meaningful health probes

Point probes at a page that truly checks the application, and allow the probe address in your security rules.

4

Design stateless servers

Keep user data outside the server so any instance can serve any user and persistence is rarely needed.

5

Plan outbound traffic on purpose

Use a NAT Gateway or explicit outbound rules and watch SNAT metrics.

ANTI-PATTERN-01 Avoid
Problem

A team uses a simple TCP probe for a website, and the load balancer keeps sending users to servers whose application has crashed but whose port is still open.

Why It’s Harmful

Users see errors even though the load balancer believes every server is healthy, and the problem is hard to notice.

Correct Approach

Use an HTTP or HTTPS probe pointed at a health page that verifies the application and its dependencies.

ANTI-PATTERN-02 Avoid
Problem

A team exposes remote management ports of every server directly through inbound NAT rules open to the whole internet.

Why It’s Harmful

Attackers constantly scan for these ports and try stolen or guessed passwords, which can lead to a full compromise.

Correct Approach

Use Azure Bastion or private connections for management, and restrict any remaining rules to trusted addresses.

ANTI-PATTERN-03 Avoid
Problem

A team expects the load balancer to route web traffic by URL path or to block malicious web requests.

Why It’s Harmful

Azure Load Balancer works at Layer 4 and cannot read web content, so these needs stay unmet and surprises appear late in the project.

Correct Approach

Use Application Gateway or Azure Front Door for web-level routing and protection, and keep the load balancer for fast Layer 4 distribution.

21Real-World Examples

Seeing how organizations use the service makes the ideas easier to remember.

A growing e-commerce website

An online shop runs its web servers in a scale set behind a public Standard load balancer. During festival sales, the scale set grows automatically and new servers join the backend pool. When a server fails its health check, it is quietly removed, and customers never see an error page.

A multiplayer game service

A game studio uses UDP traffic for fast real-time play. Because Azure Load Balancer supports UDP and adds very little delay, it spreads players across game servers without slowing the game down.

A clustered database

A company runs a database cluster whose active node must always be reachable at one fixed address. An internal load balancer with a health probe and floating IP sends traffic only to the node that is currently active, so applications reconnect to the same address after a failover.

A security appliance layer

A bank passes all traffic through a pair of virtual firewalls. An internal load balancer using HA ports spreads every kind of traffic across the two firewalls, and if one fails, the other carries on.

A worldwide service

A video-conferencing provider runs identical stacks in several regions, each behind a regional load balancer. A global load balancer in front gives users one address and sends each of them to the nearest healthy region.

“A good load balancer is invisible: users only notice that everything keeps working.”

22Frequently Asked Questions

Q1Is Azure Load Balancer the same as Application Gateway?

No. Azure Load Balancer works at Layer 4 and forwards TCP and UDP traffic without reading it. Application Gateway works at Layer 7, understands web requests, and can route by URL, end secure connections and include a web firewall. They are often used together.

Q2Can Azure Load Balancer handle HTTPS traffic?

It can forward HTTPS traffic because HTTPS runs over TCP, but it does not end or inspect the secure connection. Your servers handle the encryption. If you want the secure connection ended at the entrance, use Application Gateway or Front Door.

Q3What happens when a server fails?

The health probe fails several times in a row, and the load balancer stops sending new connections to that server. When the server recovers and passes the probe again, it is added back automatically.

Q4Can one load balancer serve several applications?

Yes. A load balancer can have several frontend IP addresses and several rules, so different ports or addresses can lead to different backend pools or services.

Q5Do I need a public IP for every server?

No. Backend servers can have only private addresses. The public load balancer holds the public address for inbound traffic, and outbound traffic can use a NAT Gateway or outbound rules.

Q6Why do all my servers show as unhealthy?

The most common causes are a security rule blocking the Azure probe address, the application not listening on the probe port, or a wrong probe path. Check these three first.

Q7Can the load balancer keep a user on the same server?

Yes, using source IP affinity, but it is better to design stateless servers that keep user data in a shared place, so persistence is not needed.

Q8Should I still use the Basic SKU?

No. The Basic SKU has been retired, so new designs should use Standard, and any remaining Basic load balancers should be upgraded. Check the official documentation for the latest status.

23Summary and Key Takeaways

Azure Load Balancer is the fast, simple traffic guide at the entrance of your cloud applications. It shares incoming TCP and UDP traffic among healthy servers, removes failed servers automatically, and lets you grow or shrink your backend without changing the address that users see. You have learned how public and internal load balancers differ, how the frontend, backend pool, health probe and rules fit together, how distribution modes and session persistence work, and how zones, outbound rules, NAT rules and special features solve particular problems.

You have also seen where Azure Load Balancer ends and where services such as Application Gateway, Front Door and Traffic Manager begin. The best designs combine the right tools, keep servers stateless, test health probes, spread resources across zones, and plan outbound connections on purpose.

Key Takeaways

  • It is a Layer 4 service — it distributes TCP and UDP traffic quickly without reading the message content.
  • Know the main parts — frontend IP, backend pool, health probe and load balancing rule work together to deliver traffic.
  • Health probes protect users — choose a meaningful probe and make sure security rules allow it.
  • Use the Standard SKU — it supports zones, larger pools and secure-by-default behavior, and the Basic SKU is retired.
  • Plan outbound traffic — use a NAT Gateway or outbound rules to avoid SNAT port exhaustion.
  • Pick the right traffic service — Load Balancer for fast Layer 4, Application Gateway or Front Door for web-aware routing, Traffic Manager for DNS-based direction.
  • Design for failure — spread servers across zones, keep them stateless, monitor probe status and practice recovery.