Microsoft Azure Documentation

Azure Load Balancer

Azure Load Balancer is a high-performance, highly available network load balancer that allows you to distribute inbound and outbound traffic to applications and services. It operates at Layer 4 (TCP/UDP) of the OSI model.

Key Features

How it Works

Azure Load Balancer uses a hash-based distribution algorithm to distribute network traffic across multiple backend instances. When a request arrives, the load balancer selects a healthy backend instance based on its rules and the health probe status.

Use Cases

Web Application Scalability

Distribute incoming web traffic across multiple web server instances to ensure performance and availability.

Backend Service High Availability

Provide a single point of access for backend services, ensuring that if one instance fails, traffic is rerouted to others.

Outbound Connectivity

Manage and scale outbound connections for virtual machines in a virtual network, preventing IP address exhaustion.

Getting Started

To get started with Azure Load Balancer, you can:

  1. Create a Load Balancer resource: Through the Azure portal, Azure CLI, or PowerShell.
  2. Configure backend pools: Define the set of virtual machines or virtual machine scale sets that will receive traffic.
  3. Define load balancing rules: Specify how inbound traffic should be distributed (e.g., port forwarding, protocols).
  4. Configure health probes: Set up probes to monitor the health of your backend instances.

Example Configuration Snippet (Azure CLI)


az network lb create \
    --resource-group MyResourceGroup \
    --name myLoadBalancer \
    --sku Standard \
    --frontend-ip-name myFrontendIP \
    --backend-pool-name myBackendPool

az network lb rule create \
    --resource-group MyResourceGroup \
    --lb-name myLoadBalancer \
    --name myHTTPRule \
    --protocol Tcp \
    --frontend-port 80 \
    --backend-port 80 \
    --frontend-ip-name myFrontendIP \
    --backend-pool-name myBackendPool \
    --disable-outbound-snat true
            

For more detailed information and advanced configurations, please refer to the official Azure Load Balancer documentation.