Introduction
A Load Balancer in Microsoft Azure is a networking service that distributes incoming network traffic across multiple virtual machines (VMs) to ensure high availability and reliability. It enhances application performance by balancing the workload and preventing any single server from being overwhelmed. Azure Load Balancer can be used for:
- Public traffic distribution (Internet-facing applications).
- Internal load balancing (for private networks).
- High availability and automatic failover by monitoring VM health.
Azure offers two types of Load Balancers:
- Public Load Balancer – Distributes traffic to VMs from the internet.
- Internal Load Balancer – Distributes traffic within a private network.
This guide provides step-by-step instructions to create and configure an Azure Load Balancer using the Azure Portal.
Step 1: Log in to Azure Portal
- Visit Azure Portal.
- Sign in with your Azure account.
Step 2: Create a Virtual Network (If Not Already Created)
A Virtual Network (VNet) is required to connect VMs to the Load Balancer.
- Go to Virtual Networks > Create.
- Provide:
- Subscription & Resource Group.
-
VNet Name (e.g.,
MyVNet
). - Region (Ensure it matches your VMs).
- Configure subnets (e.g.,
MySubnet
) and click Create.
Note: I already have a Virtual Network created in my previous lab.
Step 3: Create a Load Balancer
- Navigate to Load Balancers > Create.
- Fill in the Basic Settings:
- Subscription & Resource Group.
-
Name (e.g.,
kora_loadbalancers
). - Region (same as Virtual Network).
- SKU: Choose Standard (recommended) or Basic - (I chose Standard to distribute traffic to the backend).
-
Type:
- Public Load Balancer – For internet-facing traffic - (I selected the Public to this Lab).
- Internal Load Balancer – For private network traffic.
- Click Next: Frontend IP Configuration.
Step 4: Configure Frontend IP
- Click Add a Frontend IP Configuration.
- If Public Load Balancer (a selected above) :
- Choose Public IP Address or Create a new one. I created a new one called
kora_IP_config
.
- Choose Public IP Address or Create a new one. I created a new one called
- If Internal Load Balancer:
- Select the Virtual Network & Subnet.
- Click Next: Backend Pools.
Step 5: Create Backend Pool
A backend pool consists of virtual machines that will receive traffic from the load balancer.
- Click Add a Backend Pool.
- Provide a Name (
koraBackendPool
was used here). - Select Virtual Machines and add the VMs to the pool. - DataDiskVM1 from my previous lab post was used here.
- Click Add, then Save and Next: Inbound Rules.
Step 6: Configure Load Balancing Rules
- Click Add a load balancing rule.
-
Set:
-
Name:
koraRule
. -
Frontend IP: Select the one created earlier -
kora_IP_Config
. - Protocol: TCP.
- Port: (e.g., 80 for web traffic).
- Backend Port: Same as Frontend Port.
-
Backend Pool: Select the one created earlier -
koraBackendPool
. - Health Probe: Create a probe (port 80, HTTP).
- Session Persistence: None (or as required).
-
Name:
Click OK, then Review + Create.
There goes our Kora_loadbalancers:
Conclusion
Azure Load Balancer is an essential component for distributing traffic efficiently across multiple virtual machines. It helps maintain high availability, fault tolerance, and scalability for applications. By following these steps, you can successfully set up a Load Balancer and ensure a resilient infrastructure in Azure.
Top comments (0)