Introduction
Azure Load Balancing provides a higher level of availability across the virtual machines. We can use the Azure portal to create a basic load balancer and balance internal traffic among virtual machines. In this article, we are going to learn how to configure a load balancer in Microsoft Azure.
We have already created two virtual machines; those are:
- Virtual Machine 1: Web1
- Virtual Machine 2: Web2
Step 1
Open the Virtual Machine “Web1” and copy the Public IP address to verify the IIS web status.
Step 2
To verifying the IIS service, just paste the public IP address and hit enter. IIS server running successfully.
Step 3
Open the Virtual Machine “Web2” and copy the Public IP address to verify the IIS web status.
Step 4
To verify the IIS service, just paste the public IP address and hit enter. IIS server running successfully.
Step 5
In the Azure portal click on the “+ Create a Resource”, and then type “Load Balancer”.
Step 6
In the Load Balancer page click “Create” button to start the configuration.
Step 7
In this demo our Load balancer name is “AzureWeb” and the Public IP address name is AzPIP, and then hit “Review+Create” button.
Step 8
After successfully creating the Load Balancer, open the load balancer and check the overview.
Step 9
Now we are going to add our Virtual Machines to Load Balancer. To add the load balancer, click the “Backend pools” and click “+Add”
Step 10
Enter the backend pool name and then select where we are going to select the Virtual Machine set. Click “Associated to” in the drop down arrow and then select “Availability Set”.
Step 11
Under the “Availability set”, select the availability set in this demo; our availability set name is “iisweb”.
Step 12
Click “+Add a target Network IP Configuration” to add the Virtual Machine and the Virtual Machine IP address.
Step 13
Select the Virtual Machine and then select the IP address, and then Click “+Add a target Network IP Configuration” to add another Virtual Machine.
Step 14
Select the Second Virtual Machine and then select the IP address, and then Click “Ok”.
Step 15
Now we can verify that both Virtual Machines are added to our Backend pools.
Step 16
Now, we need to configure health probes. Health probes is what Load Balancer provides for use with load-balancing rules. Click “Health Probes”, and then Click “+Add”
Step 17
Enter the Health Probes Name and click “OK”.
Step 18
Now, the Health Probes are successfully added.
Step 19
Now, we need to create the Load Balancing Rules, the Load Balancing rules is to maps the public IP address and port number of incoming traffic to the private IP address and port number of the Virtual Machine, Click “Load Balancing Rules” and then click “+Add”.
Step 20
Enter the name, our Frontend IP address is “40.121.205.135” this is our Public IP address, and our Backend pool is selected, so verify the settings and click “Ok”.
Step 21
Now we can verify our Load Balancer is configured, it’s showing our Backend pool and public IP address, so copy the Public IP address.
Step 22
Enter our Public IP Address and hit enter. Our Web1 server is responding, now I’m going to shutdown the Web1.
Step 23
Now, refresh the page. The Web2 server is responding.
Summary
In this article, we have learned how to configure Load Balancing in Microsoft Azure. If you have any clarification, feel free to comment under the comment box.