Setting Up Azure Load Balancer for VM Load Balancing


Let’s explore how to configure a load balancer in the Microsoft Azure portal to efficiently distribute traffic among virtual machines. Assuming you have already set up essential components like a NAT gateway, virtual network, bastion host, and the load balancer itself, we will now focus on the specific steps needed to connect two VMs in different zones to the backend pool of the load balancer. This ensures optimal resource utilization and reliability in your Azure infrastructure.

Step 1. Log in to the Azure portal via

Step 2. Click on + Create a resource to begin.

Step 3. In the search bar, look for Virtual Machine, click Create, then select Virtual Machine.

Virtual machine

Step 4. In the Create a Virtual Machine page, fill in the necessary details under the Basics tab.

Create virtual machine

Provide a username and a password for the Administrator account. Ensure Public inbound ports are set to None.

Administrator account

Then, go to the Networking tab.

Step 5. Under the Networking tab, provide the necessary details.


Click on Create new under Configure network security group. Add a name and click on + Add an inbound rule.


Select HTTP as the Service, set Priority to 100, add a name, then click Add.

Add inbound security rule

Click on Review + Create. You will see that your VM has been successfully deployed.

Your deployment is complete

Repeat the same process for the second VM.

Step 6. Now, select your VM, click Connect, and choose Connect via Bastion.

Koshila lb vm

Enter the username and password, then click Connect.


Step 7. On the server desktop, go to Start > Windows PowerShell > Windows PowerShell.

Window powershell

In the PowerShell Window, run the following commands.

  • Install IIS server role: Install-WindowsFeature -name Web-Server -IncludeManagementTools.
  • Remove default htm file: Remove-Item C:inetpubwwwrootiisstart.htm.
  • Add a new htm file for displaying server name: Add-Content -Path “C:inetpubwwwrootiisstart.htm” -Value $(“Hello World from ” + $env:computername).Administrator window powershell

Repeat the same process for the second VM.

Step 8. Retrieve the frontend IP address of the relevant VM and search it on your browser. The custom VM page of the IIS Web server will be displayed.


In this article, we’ve explored how to create a load balancer to distribute VM loads using the MS Azure portal. If you have any questions, feel free to ask in the comments section.

Learn more about us at Skrots. Explore our wide range of services at Skrots Services. Also, don’t forget to check out other insightful blogs at Blog at Skrots.

Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button