Azure Load Balancer

Distribute network traffic and provide high availability for your applications.

Understanding Azure Load Balancer

Azure Load Balancer is a Layer 4 (TCP, UDP) load balancer that enables you to distribute network traffic from incoming requests to a pool of backend resources, such as virtual machines or virtual machine scale sets. It can handle millions of requests per second and provides high availability for your applications by detecting and automatically failing over to healthy instances.

Key benefits include:

Types of Azure Load Balancer

Azure Load Balancer offers two main types:

Public Load Balancer

A Public Load Balancer provides load balancing for internet-facing applications. It has a public IP address that acts as the single point of contact for clients. Traffic is directed to VMs within a virtual network.

Internal Load Balancer

An Internal Load Balancer (also known as a Private Load Balancer) is used to load balance traffic within a virtual network. It uses a private IP address for the frontend configuration and is ideal for internal applications or multi-tier applications where only specific tiers need to be exposed internally.

Outbound Load Balancing

Azure Load Balancer also provides outbound connectivity for virtual machines. It enables multiple VMs to share a single public IP address for outbound traffic, which is crucial for managing public IP address consumption.

Load Balancer SKUs

Azure Load Balancer comes in different SKUs, offering varying capabilities:

SKU Features Use Case
Standard Highly available, secure, multi-tenant, and performant. Supports Availability Zones. Advanced diagnostics. Production workloads requiring high availability, performance, and advanced features.
Basic Entry-level load balancing. Less performant and fewer features than Standard. Development, testing, or non-critical workloads.

It's recommended to use the Standard SKU for production environments due to its enhanced features and reliability.

Key Concepts

Understanding these core concepts is essential for configuring Azure Load Balancer:

Configuring Azure Load Balancer

Configuring a Load Balancer typically involves the following steps:

  1. Create a Load Balancer resource: Choose the SKU (Standard or Basic), type (Public or Internal), and optionally enable Availability Zones.
  2. Configure Frontend IP: Assign a public or private IP address.
  3. Configure Backend Pool: Add your virtual machines or scale sets to the backend pool.
  4. Configure Health Probes: Define the protocol, port, and interval for health checks.
  5. Create Load Balancing Rules: Specify the frontend IP, protocol, port, backend port, and associate it with the backend pool and health probe.
  6. Configure Outbound Rules (if applicable): Define outbound connectivity for Standard Load Balancers.
Tip: For Standard Load Balancer, consider using Availability Zones for enhanced resilience across data center failures.

Example Scenario: Web Server Load Balancing

Imagine you have three web servers (VM1, VM2, VM3) in a virtual network. You want to distribute incoming web traffic (HTTP on port 80) to these servers and ensure that if one server goes down, traffic is automatically sent to the others.

Troubleshooting Load Balancer Issues

Common issues and troubleshooting steps include:

Azure Load Balancer provides diagnostic tools that can be configured to collect metrics and logs, which are invaluable for troubleshooting.