Azure architectureBeginner32 min read

What Does Azure Load Balancer Mean?

Reviewed byJohnson Ajibi· Senior Network & Security Engineer · MSc IT Security
On This Page

Quick Definition

Think of Azure Load Balancer as a smart traffic director for your applications. It takes incoming requests and sends them to different servers so no single server gets overwhelmed. This keeps your application running smoothly even if one server goes down. It works behind the scenes to make sure users always get fast and reliable responses.

Common Commands & Configuration

az network lb create --name MyLB --resource-group MyRG --backend-pool-name MyBackendPool --frontend-ip-name MyFrontend --public-ip-address MyPublicIP

Creates a public Azure Load Balancer with a backend pool and frontend IP configuration using a public IP address.

Tests understanding of basic LB creation with required parameters; AZ-104 exams often ask about the relationship between frontend IP and backend pool.

az network lb probe create --lb-name MyLB --resource-group MyRG --name HealthProbe --protocol Http --port 80 --path /health

Creates an HTTP health probe on port 80 for a load balancer, checking the /health endpoint.

Commonly tested in AZ-104 and AWS-SAA (comparison) questions about health probes vs. health checks; ensures candidates know probe configuration for backends.

az network lb rule create --lb-name MyLB --resource-group MyRG --name HTTPRule --protocol Tcp --frontend-port 80 --backend-port 80 --backend-pool-name MyBackendPool --frontend-ip-name MyFrontend

Creates a load balancing rule mapping frontend port 80 to backend port 80 using TCP protocol.

Tests load balancing rule syntax; AWS-Developer and Google ACE exams compare to listener rules; focus on protocol and port mapping.

az network lb inbound-nat-rule create --lb-name MyLB --resource-group MyRG --name RDPRule --protocol Tcp --frontend-port 50001 --backend-port 3389 --frontend-ip-name MyFrontend

Creates an inbound NAT rule to forward external port 50001 to internal port 3389 (RDP) for direct VM access.

Distinguishes inbound NAT rules from load balancing rules in Azure exams; tests HA ports vs. individual port forwarding.

az network lb address-pool create --lb-name MyLB --resource-group MyRG --name MyBackendPool --backend-addresses '[{"ipAddress":"10.0.0.4"},{"ipAddress":"10.0.0.5"}]'

Adds VMs with specific IP addresses to a backend address pool.

Tests backend pool association methods; common in Google-ACE and Azure exams regarding static IP assignment vs. NIC-based addition.

az network lb update --name MyLB --resource-group MyRG --sku Standard --set sku.name=Standard

Updates an existing Basic SKU load balancer to Standard SKU (note: requires redeployment in reality).

SKUs are key exam topics for AZ-900 and AZ-104; questions compare Basic vs. Standard features like availability zones and SLA.

az network lb outbound-rule create --lb-name MyLB --resource-group MyRG --name OutboundRule --protocol All --frontend-ip-configs MyFrontend --backend-pool MyBackendPool

Creates an outbound rule for SNAT to provide outbound connectivity to backend VMs.

Tests understanding of outbound connectivity in Azure; AWS-Cloud-Practitioner and AZ-104 compare with NAT Gateway; common in architecture questions.

Azure Load Balancer appears directly in 11exam-style practice questions in Courseiva's question bank — one of the most-tested concepts on AZ-104. Practise them →

Must Know for Exams

Azure Load Balancer is a frequently tested topic across several Azure certification exams, especially AZ-104 (Microsoft Azure Administrator) and Azure Fundamentals (AZ-900). In AZ-104, you can expect questions on configuring load balancing rules, health probes, and backend pools. You may be asked to choose the correct SKU (Standard vs. Basic) for a given scenario, or to decide between Azure Load Balancer, Application Gateway, and Traffic Manager. The exam objectives explicitly include implementing and managing load balancing solutions. For AZ-900, the questions are more conceptual, focusing on what load balancing is, its benefits (high availability, scalability), and the difference between public and internal load balancers.

In the AWS certification exams like AWS Cloud Practitioner and AWS Solutions Architect Associate, Azure Load Balancer is not directly tested, but the concept of load balancing is universal. Understanding Azure Load Balancer helps you understand AWS Elastic Load Balancing and vice versa. Cross-cloud knowledge is valuable, and some exam questions may ask you to compare cloud services. For example, you might be asked to identify which Azure service is equivalent to AWS ALB or NLB. Knowing Azure Load Balancer thoroughly can give you an edge in such comparative questions.

Google Cloud certifications (like Google Cloud Digital Leader and Associate Cloud Engineer) also cover load balancing. Questions may involve choosing between Google's internal and external load balancers, which are conceptually similar to Azure Load Balancer. The exam traps often revolve around session persistence, health probe configurations, and understanding that Layer 4 load balancers do not inspect application data. For example, a question might describe a scenario where an application needs SSL termination or path-based routing. The correct answer would be to use Azure Application Gateway, not Load Balancer, because Load Balancer does not operate at Layer 7. Making this distinction is crucial.

Question types vary from multiple-choice scenarios (e.g., "You need to distribute traffic to VMs in an availability set. Which service should you use?") to drag-and-drop (matching components to their functions) and yes/no questions. You may also see questions that ask you to interpret metrics, such as identifying that a high number of SYN drops indicates SNAT port exhaustion. Hands-on experience with the Azure portal or CLI is invaluable because many questions test your ability to know which configuration option to set. Load balancing is a core networking concept that appears in multiple exams, and mastering Azure Load Balancer specifically will help you answer both direct and indirect questions confidently.

Simple Meaning

Imagine you own a popular food truck that serves delicious tacos. Every lunch hour, a long line of hungry customers forms at your window. At first, you handle the orders yourself, but as your business grows, the line gets longer and customers start waiting too long. Some even walk away. To solve this, you hire three more workers to take orders and prepare food. Now, when a customer arrives, you don't take their order yourself. Instead, you quickly look at which of your three coworkers is least busy and send the customer to them. This way, orders are handled faster, no one person gets overwhelmed, and if one coworker calls in sick, the other two can still serve customers with only a small delay.

In the world of cloud computing, your food truck is an application running on virtual machines in Microsoft Azure. The customers are users sending requests to that application. The coworkers are multiple virtual machines that run the same application. Azure Load Balancer is the person who directs each incoming request to the least busy virtual machine. This ensures that your application can handle many users at once, that no single virtual machine becomes a bottleneck, and that if one virtual machine fails, the load balancer automatically stops sending traffic to it and sends everything to the healthy ones. The best part is that you do not need to change your application code. The load balancer handles the distribution for you.

Azure Load Balancer operates at the transport layer of the network, which means it looks at things like IP addresses and ports to decide where to send traffic. It does not inspect the content of the data. This makes it very fast and lightweight. It is ideal for applications that need to handle a large number of connections, such as web servers, databases, or any service that benefits from being spread across multiple machines. You can configure it to use different rules, like distributing traffic evenly (round robin) or sending new connections to the server with the fewest active connections. It also performs health checks to make sure each virtual machine is responding correctly. If a virtual machine fails a health check, the load balancer stops sending traffic to it until it recovers. This automatic detection and rerouting is critical for maintaining application uptime.

Another important aspect is that Azure Load Balancer can work both for traffic coming from the internet (public load balancer) and for traffic inside a virtual network (internal load balancer). A public load balancer has a public IP address that users on the internet can reach. An internal load balancer uses only private IP addresses and is used to distribute traffic between application tiers, like between a web front end and a database back end. In both cases, the core function is the same: distribute traffic to improve performance and availability.

Azure Load Balancer is a fundamental building block for creating resilient, scalable applications in the cloud. It takes the manual work out of traffic distribution and automates it, allowing your application to handle more users and survive failures without interruption. For beginners, it is enough to understand that a load balancer makes your application more reliable and faster by sharing the work across multiple servers.

Full Technical Definition

Azure Load Balancer is a Layer 4 (transport layer) load balancing service provided by Microsoft Azure as part of its networking suite. It operates by distributing incoming network traffic across a set of backend endpoints, such as virtual machines, virtual machine scale sets, or IP addresses, based on configurable rules and health probes. The service is designed for high availability, scalability, and low latency for both inbound and outbound scenarios. It supports TCP and UDP protocols and can handle millions of concurrent connections, making it suitable for demanding production workloads.

Architecturally, Azure Load Balancer consists of several key components. The frontend IP configuration is the public or private IP address that clients connect to. For public load balancers, this is a public IP address with a corresponding domain name label. For internal load balancers, it is a private IP address within a virtual network. The backend pool is the collection of resources that receive the distributed traffic. These resources can be individual virtual machines, an entire virtual machine scale set, or a set of IP addresses within a virtual network. Health probes are used to monitor the availability of each backend instance. A health probe is configured with a protocol (TCP, HTTP, or HTTPS), a port, and an interval. If a backend instance fails to respond to a certain number of probes, it is considered unhealthy and is removed from the rotation. Load balancing rules define how traffic is distributed. Each rule maps a frontend IP and port to a backend pool and port. For example, a rule could map frontend port 80 to backend port 80 on all virtual machines in the pool. A load balancer can have multiple rules for different protocols and ports.

The distribution algorithm determines how new connections are sent to backend instances. Azure Load Balancer offers two algorithms: hash-based distribution and source IP affinity. Hash-based distribution uses a five-tuple hash (source IP, source port, destination IP, destination port, and protocol) to map each connection to a specific backend instance. This ensures that packets belonging to the same TCP or UDP session always go to the same backend, which is essential for stateful applications. Source IP affinity uses a two-tuple (source IP and destination IP) or three-tuple (source IP, destination IP, and protocol) hash, which is useful when you want all connections from a particular client to reach the same backend for session persistence. Azure Load Balancer does not support application-layer features like HTTP header inspection or SSL termination. For those features, you need Azure Application Gateway or Azure Front Door.

Azure Load Balancer can be deployed in two tiers: standard and basic. The Standard SKU offers higher performance, availability zone support, larger backend pools, and richer diagnostics. It is the recommended SKU for production workloads. The Basic SKU is intended for development and testing and has limitations such as no availability zone support and smaller scale. Both SKUs support virtual machines, virtual machine scale sets, and IP-based backends. The Standard SKU also supports cross-region load balancing (Global Load Balancer), which can distribute traffic across multiple regions for disaster recovery and global distribution.

In terms of networking, Azure Load Balancer uses Azure's software-defined networking stack. When a client sends a request to the frontend IP, the Azure network fabric intercepts the packet and applies the load balancing rules. The packet is then forwarded to the chosen backend instance using Network Address Translation (NAT). The backend instance sees the traffic as coming from the load balancer's frontend IP, not the original client. For outbound connections initiated by backend instances, the load balancer can also provide Source Network Address Translation (SNAT) to translate private IPs to the public frontend IP. This is critical for VMs that need to access the internet. The Standard SKU can be configured to use outbound rules to control SNAT port allocation.

Real-world IT implementation involves deploying Azure Load Balancer in front of a web application hosted in Azure. For example, a company running an e-commerce site would place a public Standard Load Balancer in front of a virtual machine scale set hosting the web servers. The load balancer would have a health probe checking the /health endpoint on port 443. If a web server becomes unresponsive, the health probe fails, and the load balancer stops sending traffic to that instance. The application continues to function because other healthy instances handle the load. For internal communication, an internal load balancer could be placed between the web tier and a database tier to distribute read queries across multiple database replicas. This pattern improves performance and isolates failures.

Monitoring and troubleshooting are supported through Azure Monitor, Log Analytics, and network performance monitoring tools. Metrics such as packet count, byte count, health probe status, and SNAT port utilization are available. Alerts can be set up to notify operators when health probe failures exceed a threshold or when SNAT port exhaustion is imminent. Understanding these metrics is essential for maintaining optimal performance and avoiding issues like connection drops or backend overload. Overall, Azure Load Balancer is a robust, managed service that forms the backbone of many high-availability architectures in Azure.

Real-Life Example

Imagine a busy call center for a major airline. Customers call a single toll-free number to book flights, ask questions, or change reservations. At first, there is just one customer service agent, Sarah. She answers every call, but as the airline grows, the phone rings constantly. Customers wait on hold for a long time, and many hang up frustrated. The airline decides to hire more agents: Ahmed, Mei, and Carlos. Now, when a customer calls, the phone system does not ring all four agents at once. Instead, an automated system immediately answers, listens to the customer’s request, and then sends the call to the agent who has been idle the longest. This way, no single agent is overwhelmed, and customers get served faster. If an agent needs to take a break or gets sick, the system automatically stops sending calls to that agent until they are available again. The customer never knows which agent they are talking to, and they always get help.

This call center is exactly how Azure Load Balancer works for a web application. The airline’s toll-free number is the load balancer’s frontend IP address. The agents Sarah, Ahmed, Mei, and Carlos are the virtual machines or containers running your application. The automated phone system that decides which agent gets the next call is the load balancing algorithm. The system checks if an agent is available (not on a call, not on break) before sending them a customer. That is the health probe. If an agent is sick and cannot take calls, the system stops sending them calls temporarily. In Azure, the health probe checks if a virtual machine is responding on a specific port. If the VM fails, it is removed from the backend pool until it recovers.

Now imagine the airline opens a second call center in a different city to handle calls from another region. Customers still dial the same toll-free number, but the phone system now routes calls to the nearest center based on the caller’s area code. This is similar to a global load balancer that distributes traffic across regions. All of this happens automatically and transparently to the customer. They just dial the number and get help. In the same way, a user visits your website, and Azure Load Balancer directs their request to a healthy server, possibly in a data center close to them. The user sees a fast, responsive site, and the company enjoys high availability and scalability without complex manual management.

This analogy also illustrates the difference between public and internal load balancers. The toll-free number is public because anyone can call it. An internal load balancer is like a private extension line that only employees use to call other departments within the company. For example, when an agent needs to check a fare database, they dial an internal number that is not published to customers. That internal number is the internal load balancer’s frontend IP, and the database servers are the backend pool. This separation keeps internal services secure and organized. Azure Load Balancer is the hidden, intelligent dispatcher that keeps your application running smoothly, no matter how many users connect.

Why This Term Matters

In modern IT infrastructure, applications must be available 24/7 and handle fluctuating user demand. Without a load balancer, you would have to manually distribute traffic or rely on a single server, which creates a single point of failure. If that one server crashes, your entire application goes down. Azure Load Balancer solves this by allowing you to run multiple copies of your application and automatically sending traffic to the healthy ones. This is critical for businesses that cannot afford downtime, such as e-commerce sites, banking portals, or healthcare systems. Even a few minutes of downtime can cost thousands of dollars in lost revenue and damage to reputation.

Another reason it matters is scalability. During a flash sale or a product launch, traffic to your site can spike dramatically. Azure Load Balancer works with virtual machine scale sets to automatically add more instances when demand increases. The load balancer immediately starts sending traffic to the new instances, ensuring that user response times remain fast. When demand drops, instances can be removed, and the load balancer stops sending traffic to them. This elasticity saves money because you only pay for the resources you use, but it also ensures your application never buckles under pressure.

From a security perspective, Azure Load Balancer can also act as a first line of defense. By distributing traffic across multiple backend instances, it makes it harder for a denial-of-service attack to overwhelm a single point. An internal load balancer can keep backend databases and application tiers completely isolated from the internet, reducing the attack surface. Azure Load Balancer integrates with Azure Firewall, Network Security Groups, and DDoS Protection to provide layered security. For IT professionals, mastering load balancer configuration is essential for designing robust, secure, and cost-effective cloud architectures. It is not just a nice-to-have; it is a foundational component of any production-grade application.

How It Appears in Exam Questions

Exam questions about Azure Load Balancer often appear in scenario-based formats. You are given a business requirement, such as needing high availability for a web application, and you must select the correct Azure service or configuration. For example: "Your company runs a web application on two virtual machines in an availability set. You need to distribute incoming HTTP traffic evenly between the VMs and automatically remove any VM that fails." The answer would be Azure Load Balancer with a health probe. Another pattern involves choosing between load balancer and Application Gateway. You might see: "Your application needs SSL offloading and URL-based routing." The correct answer is Application Gateway, not Load Balancer, because Load Balancer does not handle Layer 7 features.

Configuration-based questions are also common. You might be asked to set up a load balancer rule that maps frontend port 80 to backend port 8080, and you need to select the correct protocol (TCP) and distribution method. Or you might be given a health probe configuration that uses HTTP on port 80 with a path of /health, and you need to decide what happens when a VM returns a 404 status code. The correct understanding is that the health probe considers a non-200 status as a failure, so the VM is removed.

Troubleshooting questions present symptoms and ask for the root cause. For example: "Users report that they cannot connect to a web application behind a public load balancer. The VMs are running and healthy. What is the most likely cause?" Possible answers include a missing network security group rule that blocks the load balancer health probe, or an incorrect frontend port configuration. Another common trap: "A web application works intermittently. Connections from the same client sometimes go to different servers, causing session state to be lost." This points to the need for session persistence (source IP affinity), which is not enabled by default.

You may also encounter questions that test your knowledge of SKU differences. For instance: "You need a load balancer that supports Availability Zones and a larger backend pool. Which SKU should you choose?" The answer is Standard. Or: "You are testing a development environment and need a cost-effective load balancer. Which SKU is appropriate?" Basic. These questions are straightforward but require memorization. Finally, some questions integrate load balancing with auto-scaling. For example: "You have a virtual machine scale set behind a load balancer. When CPU reaches 80%, a new VM is added. How does the load balancer handle the new VM?" The answer: the load balancer automatically starts sending traffic to the new VM once it passes the health probe. Understanding this interplay is important.

Practise Azure Load Balancer Questions

Test your understanding with exam-style practice questions.

Practise

Example Scenario

Scenario: Tailwind Traders is an online retail company that runs its website on two virtual machines in the East US region. The website sells handmade furniture and gets heavy traffic during weekday evenings. The company wants to ensure the website remains available even if one virtual machine goes down, and they want to spread user requests evenly between the two machines. The website listens on port 443 for HTTPS traffic. The IT team needs to configure a solution that meets these requirements with minimal cost and management overhead.

Solution: The IT team decides to deploy Azure Load Balancer. They create a public Standard Load Balancer with a frontend IP address. They configure a backend pool containing the two virtual machines, which are in the same virtual network. They create a health probe that checks for a response on port 443 every 15 seconds. If a virtual machine does not respond to two consecutive probes, it is marked as unhealthy and removed from the rotation. They also create a load balancing rule that maps incoming traffic on frontend port 443 to backend port 443, using the hash-based distribution algorithm (default). This ensures that each user’s HTTPS session stays on the same virtual machine, which is important because the website uses a local session store. They do not enable session persistence because the default hash already provides session stickiness for the duration of a connection.

When a virtual machine fails, the load balancer automatically stops sending new requests to it. Users who were connected to the failed machine may lose their session, but new users will be directed to the healthy machine. The company later implements a virtual machine scale set behind the same load balancer to automatically add more instances during peak traffic hours. The load balancer integrates with the scale set, automatically detecting new instances as they come online. This setup provides high availability, scalability, and fault tolerance with minimal manual intervention. The company now has a cost-effective solution that keeps its website running smoothly even during flash sales or unexpected traffic spikes.

Common Mistakes

Thinking Azure Load Balancer can inspect HTTP headers or perform SSL termination.

Azure Load Balancer operates at Layer 4 (TCP/UDP) and does not understand application-level data. It cannot route based on URL paths, host headers, or perform SSL offloading.

Remember that Layer 4 load balancers only look at IP addresses and ports. For application-level features, use Azure Application Gateway or Azure Front Door.

Assuming the default distribution algorithm provides per-client session stickiness for all scenarios.

The default hash-based distribution uses a five-tuple hash that includes source port. If a client's source port changes (which is common with NAT), the hash value changes and the request may be sent to a different backend. This breaks session persistence.

If your application requires session stickiness regardless of source port changes, enable source IP affinity (two-tuple or three-tuple hash) in the load balancing rule.

Forgetting to allow health probe traffic in Network Security Group (NSG) rules.

Health probes originate from Azure's infrastructure IP addresses (168.63.129.16). If the NSG on the backend VM denies traffic from this IP, the health probe fails, and the load balancer marks the VM as unhealthy, removing it from the pool.

Add an NSG rule that allows inbound traffic from the AzureLoadBalancer service tag (or the specific IP 168.63.129.16) on the health probe port.

Using Basic Load Balancer for production workloads requiring high availability or availability zones.

Basic Load Balancer does not support Availability Zones, has a smaller backend pool limit (300 vs. 1000), and does not provide diagnostics metrics. It is not suitable for production environments.

Always use Standard Load Balancer for production. Reserve Basic for development and testing only.

Confusing Azure Load Balancer with Azure Traffic Manager.

Traffic Manager is a DNS-based traffic routing service that operates at Layer 7 and can distribute traffic across different regions. Load Balancer operates at Layer 4 within a single region. They serve different purposes and are often used together.

Use Load Balancer for distributing traffic within a region, and Traffic Manager for routing traffic across regions based on latency, geography, or priority.

Exam Trap — Don't Get Fooled

{"trap":"A question describes an application that requires SSL offloading, URL-based routing, and WebSocket support. The learner chooses Azure Load Balancer because it is the most well-known Azure load balancing service.","why_learners_choose_it":"Learners often associate any traffic distribution need with Load Balancer.

They may not be aware of the differences between Layer 4 and Layer 7 services. SSL offloading and URL routing are Layer 7 features, and Load Balancer does not support them.","how_to_avoid_it":"Remember that Azure Load Balancer is strictly Layer 4 (TCP/UDP).

For Layer 7 features like SSL termination, cookie-based affinity, and URL path routing, you need Azure Application Gateway. For global load balancing with routing policies, use Azure Traffic Manager or Azure Front Door. Always check the feature list before selecting a service."

Commonly Confused With

Azure Load BalancervsAzure Application Gateway

Azure Application Gateway is a Layer 7 web traffic load balancer. It can inspect HTTP headers, perform SSL termination, route based on URL paths, and support WebSocket and HTTP/2. Azure Load Balancer works at Layer 4 and does not have these capabilities.

If you need to route requests to /api to one pool and /images to another, use Application Gateway. If you just need to balance TCP traffic across servers, use Load Balancer.

Azure Load BalancervsAzure Traffic Manager

Azure Traffic Manager is a DNS-based traffic router that operates at the global level. It can direct users to the nearest regional endpoint based on latency, geography, or priority. Azure Load Balancer distributes traffic within a single region. They are complementary, not interchangeable.

Traffic Manager sends users from Europe to a European data center, while Load Balancer inside that data center distributes the user's request across multiple VMs.

Azure Load BalancervsAzure Front Door

Azure Front Door is a global, scalable entry point that provides both load balancing and web application firewall capabilities. It operates at Layer 7 and can route traffic across regions based on latency, with support for SSL termination and URL rewriting. Load Balancer is regional and Layer 4 only.

Use Front Door for global applications that need fast, secure delivery. Use Load Balancer for regional load balancing of any TCP/UDP traffic.

Azure Load BalancervsNetwork Load Balancer (NLB) in AWS

AWS NLB is also a Layer 4 load balancer, similar in concept to Azure Load Balancer. However, NLB can preserve the source IP of the client when forwarding traffic, while Azure Load Balancer does not preserve the source IP by default. Both support TCP and UDP.

If you need the backend application to see the client's real IP address, AWS NLB provides that feature natively; with Azure Load Balancer, you would need to enable Proxy Protocol to preserve source IP.

Step-by-Step Breakdown

1

Create a Virtual Network

Start by setting up a virtual network in Azure where your backend resources will reside. This network defines the IP address space and subnets. All resources must be in the same virtual network or connected via peering for the load balancer to reach them.

2

Deploy Backend Resources

Create the virtual machines, virtual machine scale sets, or IP-based resources that will serve your application. Ensure they are properly configured with the application running and listening on the expected port. For high availability, place VMs in an availability set or across availability zones.

3

Create the Load Balancer Resource

In the Azure portal, create a new Load Balancer resource. Choose the SKU (Standard for production), type (Public or Internal), and assign it to the correct virtual network and subnet. For a public load balancer, you will also create or assign a public IP address.

4

Configure the Frontend IP

Define the frontend IP configuration that clients will connect to. For a public load balancer, this is a public IP. For an internal load balancer, this is a private IP from your virtual network. You can add multiple frontend IPs to handle different ports or protocols.

5

Create the Backend Pool

Create a backend pool and add the backend resources you deployed earlier. You can add individual VMs, an entire virtual machine scale set, or IP addresses. The load balancer will only send traffic to instances that are healthy in this pool.

6

Configure Health Probes

Set up a health probe to monitor the availability of your backend instances. Choose the protocol (TCP, HTTP, or HTTPS), specify the port, and set the probe interval and failure threshold. The health probe determines if a backend is healthy enough to receive traffic.

7

Create Load Balancing Rules

Define one or more load balancing rules that map frontend traffic to the backend pool. Each rule specifies a frontend IP, frontend port, backend port, protocol, and optionally a session persistence method. The rule tells the load balancer how to distribute incoming traffic.

8

Configure Network Security Groups (Optional but Recommended)

Apply NSGs to your backend subnets or individual VMs to control inbound and outbound traffic. Remember to allow traffic from the AzureLoadBalancer service tag on the health probe port. Without this, health probes will fail.

9

Test and Validate

After configuration, test the setup by sending requests to the frontend IP address. Verify that traffic is distributed across the backend instances. Check the health probe status in the Azure portal. Simulate a failure by stopping one VM and confirm that the load balancer removes it from rotation.

10

Monitor and Tune

Use Azure Monitor to track load balancer metrics like packet count, health probe status, and SNAT port usage. Set up alerts for unhealthy backends or high latency. Adjust health probe intervals or load balancing rules based on application behavior to optimize performance.

Practical Mini-Lesson

For IT professionals, configuring Azure Load Balancer correctly involves understanding both the infrastructure requirements and the application's needs. A common real-world scenario is setting up a load-balanced web application that must handle secure HTTPS traffic. First, you need to decide whether to terminate SSL at the load balancer or at the backend. Since Azure Load Balancer cannot terminate SSL (Layer 4), your backend VMs must handle HTTPS directly, or you must place an Application Gateway in front. If you choose to keep Load Balancer, ensure each VM has a valid SSL certificate and listens on port 443. The health probe should also be configured for HTTPS to verify that the application is fully functional, not just that the network layer is responsive.

Another practical consideration is SNAT port exhaustion. When backend VMs initiate outbound connections (e.g., to a database or an external API), the load balancer uses SNAT to map the VM's private IP to the load balancer's public frontend IP. Each outbound connection consumes a SNAT port. If your VMs create many outbound connections, they can exhaust the available SNAT ports, leading to connection failures. The Standard SKU provides 64,000 ports per frontend IP, which is usually sufficient, but you can also allocate dedicated outbound rules to manage port allocation. Monitoring SNAT port utilization through metrics is essential to avoid this issue.

In production, you often combine Azure Load Balancer with Virtual Machine Scale Sets. The load balancer automatically detects new instances added by the scale set and starts sending traffic to them after they pass a health probe. This allows for seamless auto-scaling. However, you must ensure that the health probe is correctly configured to reflect true application readiness. A common mistake is to use a TCP health probe on the application port, which only confirms that the port is open, not that the application is ready to serve requests. For critical applications, use an HTTP/HTTPS health probe that checks a specific endpoint like /health that validates database connectivity and internal state.

What can go wrong? Besides NSG blocking health probes, another issue is backend instance failure due to misconfigured load balancing rules. For example, if you map frontend port 443 to backend port 80, the backend must be listening on port 80. If the application listens on 443, the rule is wrong. Also, if you use the default hash distribution, a client may be sent to a different backend after a session timeout, which can cause session state loss. To mitigate this, store session state in a shared Redis cache or database rather than in memory on each VM. Or, enable source IP affinity if the session must remain on the same VM.

Finally, managing costs is important. Standard Load Balancer has a fixed hourly cost plus data processing charges. Basic Load Balancer is free but lacks features. For non-production environments, consider using Basic Load Balancer to save costs, but be aware of its limitations. For production, Standard is necessary. Also, avoid deploying unnecessary load balancers. If your application runs on a single VM and does not need high availability, a load balancer adds cost and complexity without benefit. Regularly review your backend pool and remove unused instances. By keeping these practical points in mind, you can design a robust, cost-efficient, and high-performing load balancing solution.

Troubleshooting Clues

Backend VMs marked unhealthy despite running

Symptom: Health probe shows 'Unhealthy' for all VMs in the backend pool; traffic does not reach any VM.

The health probe is failing because either the probe path (e.g., /health) is not exposed, the firewall on the VM blocks the probe, or the backend port is not listening. By default, Azure Load Balancer probes come from the host IP (168.63.129.16), which must be allowed.

Exam clue: Questions present a scenario where VMs are running but not receiving traffic; correct answer involves checking NSG rules allowing AzureLoadBalancer tag or probe destination.

Connection drops after idle timeout

Symptom: Long-running TCP connections (e.g., SSH, database) disconnect after 4 minutes of inactivity.

Default idle timeout is 4 minutes for Basic and Standard SKUs. After timeout, the load balancer closes the session. Can be increased up to 30 minutes via rule configuration or use Keep-Alive at application layer.

Exam clue: Exams describe connectivity issues with persistent connections; solution is to increase idle timeout or enable TCP keep-alive; tests understanding of session timeout.

Session persistence not working (sticky sessions)

Symptom: User requests are routed to different backend VMs during a session, causing inconsistent state.

Session persistence (source IP hash or client IP affinity) must be configured in the load balancing rule. If set to 'None', the load balancer uses 5-tuple hash, which can change backend VM.

Exam clue: Common AWS-SAA and AZ-104 question: scenario with shopping cart lost; answer is to enable 'Client IP' persistence on the rule.

Backend VMs not receiving traffic when behind internal LB

Symptom: Traffic from on-premises or peered VNet to internal LB frontend fails; VMs are unreachable.

Internal load balancers require that the backend VMs are in the same VNet or a peered VNet with proper routing. Also, backend VMs must have the LB frontend IP reachable; if VMs are on a different subnet without route, traffic is dropped.

Exam clue: AZ-104 and Google-ACE questions about hybrid connectivity: failure to reach internal LB due to missing route table or NSG rules on backend subnet.

Outbound SNAT ports exhausted

Symptom: Backend VMs cannot make outbound connections to the internet; timeouts on outbound traffic.

Each backend VM is allocated a limited number of SNAT ports (based on SKU and size). With high connection counts, ports are exhausted. Need to increase backend pool size, use Standard SKU with outbound rules, or deploy NAT Gateway.

Exam clue: AWS-Cloud-Practitioner and AZ-900 compare SNAT with AWS NAT; AZ-104 scenarios ask for scaling solution (add VMs, use NAT Gateway).

Load balancer in failed state after update

Symptom: Azure portal shows 'Failed' provisioning state; rules or probes not applied.

This often occurs when an invalid combination of parameters is used (e.g., Basic SKU with availability zones, or conflicting NSG rules). The load balancer update was rejected but state changed.

Exam clue: Exams ask about troubleshooting provisioning failures; answer is to review error details in Azure Resource Manager (ARM) activity logs.

Traffic not hashing correctly with multiple frontends

Symptom: Uneven distribution of traffic across backend VMs even with similar configuration.

Each load balancing rule uses its own frontend IP. If multiple frontend IPs target the same backend pool, the hash algorithm distributes per frontend, not globally. This can cause imbalance if frontends have different traffic patterns.

Exam clue: Advanced AZ-104 question about distribution with multiple IPs; answer involves understanding that each rule is independent.

Cross-region load balancer not working

Symptom: Traffic from global frontend does not route to backend in secondary region.

Cross-region load balancer requires Standard SKU in both regions, proper health probes, and that the backend pool contains a regional load balancer. Also, the regional LB must have healthy endpoints.

Exam clue: Google-Cloud-Digital-Leader and AZ-104: solution is to verify health of regional LBs and ensure they are configured as backends.

Memory Tip

Remember the three Hs: Health Probes, Hash Distribution, and High Availability. If you forget which layer, think "LB = Layer 4, Low level."

Learn This Topic Fully

This glossary page explains what Azure Load Balancer means. For a complete lesson with labs and practice, see the topic guide.

Covered in These Exams

Current Exam Context

Current exam versions that test this topic — use these objectives when studying.

Related Glossary Terms

Quick Knowledge Check

1.A company has an Azure Load Balancer with two backend VMs. Users report that their sessions are dropped after 4 minutes of inactivity. What is the most likely cause?

2.An administrator deploys a Standard Azure Load Balancer with a health probe on port 80. The backend VMs are running IIS, but the health probe shows 'Unhealthy'. What should the administrator check first?

3.A company needs to forward RDP traffic from a public IP on port 50001 to a specific backend VM's port 3389. Which Azure Load Balancer component should be configured?

4.A developer uses Azure Load Balancer to distribute traffic to two web servers. Due to regulatory requirements, all traffic from a specific client IP must go to the same backend VM. What should be configured?

5.An organization's backend VMs behind a Basic Azure Load Balancer are experiencing outbound connectivity failures. The VMs are unable to reach external APIs. What is the most efficient solution?