Achieving High Availability with Azure Load Balancer

Step by Step Practice Lab

What is a Load Balancer?

A load balancer is a server-side architecture that distributes the client’s load to the server. The load balancer sends requests to one server and forwards them to another server.

The Microsoft Azure Load Balancer can be used to create a load balancer, to configure and show how it works. This solution can be used to increase the High availability within the same azure region by creating multiple Azure virtual machines connected through a load balancer.

The main role of a load balancer is to transfer and distribute the load (data) from clients to servers. They inspect the client request, determine which server can fulfill it and which server is under load, check this load balancing, and send the request to that server.

It's a very important thing , which can provide you with significant benefits by bringing several advantages over the traditional configurations of server-based architectures.

Microsoft Azure Load Balancer Features

• Health Probe

• Port forwarding

• Load balancing

• Outgoing connections

• Standard load balancing

• Automatic reconfiguration

• Application independence and transparency

Hello good Day,

 Today we will show you step by step how to create a virtual network and virtual machine, how to create a load balancer or health probe, how to configure it, and how it works.

Precondition

 A Microsoft Cloud Azure account with a subscription. 

 Let’s start

Steps to Create a Azure Load Balancer

Step 1: Log in to your Microsoft Azure account. (https://portal.azure.com)


Step 2: Create a  Azure VNet (Virtual Network)

Go to Home page >Click "Create a resource" > Search in

“virtual network" > click "Create".


Open a new tab for Create a virtual network

· Show the field resource group, create a new Resource group and name the resource group something like (TestRG) and whatever you think of it.

· Instance information

o Name: Please enter your name

o Region: Please select a region (Name and Region are Required)

o Click Next: IP Address


· Go to IP address space – you can show the default IP 10.0.0.0/16 In use this or create a new range

· After the IP address space, the next step is to create a subnet. Click Add Subnet



· Open a new window on the right

· Name the subnet and specify the subnet range, for example, 192.168.0.0/24.

· After the name and scope of the given subnet

· Click Next: Security - You do not need to change this tab.

· Click Next: Tags - No changes are required on this tab.

· Click Next: Review and Create > And wait for validation is completed then click Create.

· After clicking Create, wait a moment.

· It can show that the virtual network has been deployed.

· After deployment is complete, the virtual network is ready.


Step 2: Create a Virtual Machine

· Go to the Home page > click Create resource > select Windows Server 2019 datacenter (the virtual machine is Windows).


· Select the resource group you created in the virtual network.

· Specifies the name of the details virtual machine in the instance.

· Choose the region, availability option, and availability zone that fits your needs.

· Keep your settings the same and go to your admin account >

· Enter your username and password

· Click Next: Disk.


· There are no changes on the Disks tab, so click

Next: Network > (if you want to make any changes, you must).

· Network Interface > Select Network in Virtual Machine > Select Subnet > Select the "Advance" checkbox in the NIC Network Security group > "All settings are the same." > Click “Next: Management".


· Management Tab Select Disable in Boot Diagnostic then Click Next : Advanced > (if you want to make any changes, you must).


· No Changes In Advance Tab SO Click Next : Tags> (if you want to make any changes, you must).

· No Changes In Tgas Tab SO Click Next : Review + Create > (if you want to make any changes, you must).

· After going through all the basic settings, everything should be fine. Then click Create and wait for deployment.


· Your first virtual machine is ready.

· Then follow the same steps to create one more virtual machine.

· Step 3: Run the Power Shell command to start and run the IIS script on the virtual machine.

· Select > RunPowerShellScript > And Run Script.


For Reference(Power Shellscript) :

Install-WindowsFeature -name Web-Server -IncludeManagementTools

remove-item C:\inetpub\wwwroot\iisstart.htm

Add-Content -Path "C:\inetpub\wwwroot\iisstart.htm" -Value $("Hello World from host " + $env:computername)

· Run the script and wait for it to finish.

Step 4: Create network security group rules.

· Go to Home > Select Resource Group (ronakRG9) > ronakvm1-nsg (this box appears under Resources in the overview).

· After the ronakvm1-nsg parameter, click > Settings > Inbound Security Rules.


· After Click Inbound Security rules > Click ADD

· Then click Add and open a new tab > Add Inbound Security Rule > Then Fill in as per your requirements and click "Add".

· Then wait for a while for the NSG rule to be created or deployed.

Step 5: Configure Load Balancer

· Go To Home > Create a Resources > Search Load Balancer (Microsoft) and Select.

· Open Load Balancer by (Microsoft) > Click then Open And Click Create .


· Then open Load balancer >Select Resources Group (ronakRG9) > In Instance Detail > Give name of Load Balancer > select Region and then Click > Next : Frontend IP Configuration



· Then open Frontend IP Configuration > Add Frontend IP Configuration > Click the tab. In this tab, provide a name for the frontend IP address > Create a new address from the public IP > click "Name" and click OK > Add > Next: Backend Pool.


· Then "Add Backend Pool" > "Name the Backend Pool" > Open the "Choose Virtual Network" tab we created.

· Then IP Configuration Click ADD ,

· After Clicking ADD > Select Our All Virtual Machine (In Our Case we made 2, you can select more) > click ADD > Then Save.

· Then Click Next : Inbound Rule


· After Clicking Next: Inbound Rules.

· This step is the most important for load balancing.

· Under Load Balancing Rules,> click add load balancing rule > open new windows.

· New Windows is Load balancing rule > Give name of load balancing > select fronted IP > select backend pool > select port (as per your requirement)> select backend port.



· Then Health Probe > Click Create New > Open New Tabe Give Name Health Probe Name > Select Protocol > Give Port > Select Intervel > Click ok.


· After Click Next: Outbound Rule no Changes In this Tab Then Click Next: Tags.

· No changes In Tags Tab SO Click Next : Review and Create.

· Check All Options You Fill and Then Click Create.

· Wait A Minute For Create and Deploying Load Balancer.


· The load balancer is now ready to check the virtual machines one by one and see if the load is being transferred.

Load Balancer Topology.


Load balancing is a service. Many such services are available in the Azure cloud. Want to learn more and prepare for AZ- 104 Microsoft Azure Administrator exam? Check out our comprehensive video course for Azure Administrator.


Maruti Makwana
An Indian, Coach, Learner, Father, Husband, and Friend for a few chosen ones.

Launch your GraphyLaunch your Graphy
100K+ creators trust Graphy to teach online
𝕏
Mentor's TAG 2024 Privacy policy Terms of use Contact us Refund policy