Setting Up Azure Load Balancer for VM Load Balancing
Introduction
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 https://portal.azure.com
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.
Step 4. In the Create a Virtual Machine page, fill in the necessary details under the Basics tab.
Provide a username and a password for the Administrator account. Ensure Public inbound ports are set to None.
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.
Click on Review + Create. You will see that your VM has been successfully deployed.
Repeat the same process for the second VM.
Step 6. Now, select your VM, click Connect, and choose Connect via Bastion.
Enter the username and password, then click Connect.
Step 7. On the server desktop, go to Start > Windows PowerShell > Windows 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).
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.
Summary
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.
Know more about our company at Skrots. Know more about our services at Skrots Services, Also checkout all other blogs at Blog at Skrots
Thanks, Harsh
Founder | CEO — Skrots
Learn more about our blog at Blog at Skrots. Checkout our list of services on Skrots. Give a look at our website design at Skrots . Checkout our LinkedIn Page at LinkedIn.com. Check out our original post at https://blog.skrots.com/creating-azure-load-balancer-for-vm-load-balancing/?feed_id=5237&_unique_id=65fc2fcac1003