In this short blog, we will show you how to create an Azure Load Balancer Rule. Azure Load Balancer allows for the creation of rules to control traffic to the backend pool. Here’s a brief overview of the steps required to make a load balancer rule in Azure.
- Create a Load Balancer
- Create and Configure the Backend Pools
- Create a Health Probe, and lastly,
- Create a Load Balancing Rule
The following blog will show you some details of the same, in-depth.
Let’s get started with some basics first!
What Is The Use of An Azure Load Balancer?
We use an Azure Load Balancer to distribute inbound traffic loads to backend pool instances such as virtual machines or virtual machine scale sets. We do this according to configured load-balancing rules and health probes. Moreover, Azure Load Balancer provides high availability for your applications.
Now, let’s move onto how to create a load balancer rule.
How to Create an Azure Load Balancer Rule
- Creating a Load Balancer
Here are the steps to create a load balancer!
Step 1: Go to the Azure portal and search for Load Balancer and click Create Load Balancer.
Step 2: Under Project details, select Subscription and Resource group.
Step 3: Under Instance details, provide a Name, Region, Type, SKU, and Tier.
Which Type Of Load Balancer Should You Choose?
|Public load balancer||You can use this type to load balance internet traffic to virtual machines.|
|Internal (private) load balancer||is used to balance traffic from within a virtual network (not the internet traffic)|
Which Type of SKU (Stock Keeping Unit) Should You Select?
|Basic||This type of SKU provides basic features and is restricted to some limits. For example, the backend pool size is restricted to only 300 instances. It’s restricted to a single availability set etc.|
|Standard||The Standard tier load balancer is generally available and we can scale out to 1000 instances and can span any virtual machine in a single virtual network, including multiple scale sets, availability sets, and machines.|
Step 4: Under the public IP address, create or use an existing IP address and provide the IP address name.
Step 5: If we choose a Standard Load Balancer, IP address assignment will be static and cannot be changed. If the Load Balancer is of the Basic type, we can choose the IP address assignment as either Dynamic or Static.
Step 6: Select Availability zone and Routing preference.
Step 7: Click Review + Create.
- Creating and Configuring A Backend Pool
A backend pool contains the IP addresses of the virtual machines or the virtual machine details connected to the load balancer.
Step 1: Select All services and select the load balancer (SysAllyLB) we have created Under Settings menu, select Backend pools, and click Add.
Step 2: Provide a Name and select the Virtual network.
Step 3: Under the Backend Pool Configuration, select the type either NIC or IP address.
|IP Address||If you choose the IP address type, you can select the VMs to where the internet traffic is to be distributed by using the IP address of the VM.|
|NIC||If you choose NIC type, you can add VMs to the Virtual Machines section.|
You can only attach virtual machines in the exact same location and on the same virtual network as the load balancer.
Virtual machines must have a standard SKU public IP or no public IP. And, all virtual machines must be under the same availability set.]
Step 4: Click Add.
- Create A Health Probe
A load balancer monitors the status of your app or VM. The health probe adds or removes VMs from the load balancer backend pool based on their response to the periodic health checks.
Step 1: Select All resources and select the load balancer (SysAllyLB) we have created. Under the Settings menu, choose Health Probes, and click Add.
Step 2: Provide Name, Protocol, Port, Interval in seconds and Unhealthy threshold.
|Interval||This is the number of intervals in seconds between each health check.|
|Unhealthy threshold||This is the number of consecutive health check failures that must occur before a VM is considered unhealthy.|
Step 3: Click Add.
- Create a load balancer rule
We use a load balancer rule to define how to distribute traffic to VMs. You express the frontend IP configuration for the incoming traffic and the backend IP pool to receive the traffic. The source and destination port are defined in the rule.
Step 1: Select All resources and select the load balancer (SysAllyLB) we have created Under Settings menu, select Load balancing rules, and click Add.
Provide the following details:
|Name||Name of the rule|
|IP Version||Type of IP|
|Frontend IP||IP of this Load balancer|
|Protocol||TCP or UDP|
|Backend port||the port to be redirected|
|Backend pool||Backend pool created|
|Health probe||Health probe created|
Step 2: Click OK.
So follow these steps and create your own load balancing rules in Azure.
At SysAlly, we experiment with Cloud and the most useful information is passed on to the world as blogs. Signup for the updates.
Until later, here’s SysAlly signing off!