Azure Load Balancer

Distribute network traffic and improve application availability with Azure Load Balancer.

On this page

Introduction to Azure Load Balancer

Azure Load Balancer is a high-performance, low-latency Layer 4 load balancer that distributes incoming traffic across a pool of backend resources, such as virtual machines or virtual machine scale sets. It provides a highly available and scalable solution for your applications.

It operates on TCP and UDP protocols and can handle millions of concurrent connections. Azure Load Balancer is designed to be resilient and fault-tolerant, ensuring your applications remain accessible even during hardware failures.

Azure Load Balancer Architecture

Diagram illustrating Azure Load Balancer distribution.

Key Features

How Azure Load Balancer Works

Azure Load Balancer works by assigning a public or internal IP address to the load balancer. Incoming network traffic directed to this IP address is then evaluated based on configured load balancing rules.

These rules define how traffic is distributed to backend pool instances. Health probes are essential for maintaining the availability of your application. If a health probe detects that a backend instance is unhealthy, the load balancer will stop sending traffic to that instance until it becomes healthy again.

The process typically involves:

  1. A client sends a request to the load balancer's IP address.
  2. The load balancer receives the request and checks its configured rules.
  3. A health probe verifies the health of the available backend instances.
  4. Based on the rules and health probe status, the load balancer selects a healthy backend instance.
  5. The load balancer forwards the request to the chosen backend instance.
  6. The backend instance processes the request and sends the response directly back to the client (Direct Server Return).

Types of Azure Load Balancers

Azure offers two main types of load balancers:

Standard Load Balancer

Standard Load Balancer offers advanced features for production workloads, including:

  • Public and internal IP address support.
  • Support for multiple frontend IP configurations.
  • Network Security Group (NSG) filtering.
  • Availability Zones for high availability.
  • Custom health probes.
  • Diagnostic logging.

Basic Load Balancer

Basic Load Balancer is a simpler, more cost-effective option suitable for development and test environments or less critical workloads. It offers:

  • Public IP address support only.
  • Limited frontend IP configurations.
  • Standard health probes.

Common Use Cases

Azure Load Balancer is ideal for a variety of scenarios:

Highly Available Applications

Ensure continuous availability of web servers, APIs, and other services by distributing traffic across multiple instances.

Scalable Backends

Effortlessly scale your application's backend by adding or removing instances and letting the load balancer distribute traffic accordingly.

Dev/Test Environments

Provide load balancing capabilities for development and testing purposes without incurring high costs.

Pricing

Azure Load Balancer pricing is based on the SKU (Basic or Standard) and the number of rules configured. Standard Load Balancer has a higher hourly cost but offers more features and better performance for production environments.

For detailed pricing information, please refer to the official Azure Load Balancer pricing page.

Getting Started with Azure Load Balancer

You can create and configure Azure Load Balancer using the Azure portal, Azure CLI, Azure PowerShell, or ARM templates.

Here's a quick overview of the steps involved:

  1. Create a Load Balancer: Choose the SKU (Basic or Standard) and whether it's public or internal.
  2. Configure Frontend IP: Assign a public or private IP address to the load balancer.
  3. Define Backend Pool: Specify the virtual machines or scale sets that will receive traffic.
  4. Create Health Probes: Configure probes to monitor the health of backend instances.
  5. Set Up Load Balancing Rules: Define rules that map frontend ports and protocols to backend ports and protocols.

You can find comprehensive step-by-step guides in the official Azure documentation: