Welcome back to an article about creating another Windows Server Machine on Virtual Network and working with Load Balancing. Here, in this article, we will be working with the Virtual Network and we will be creating a Load Balancer on it.

Note

Please go back to my previous article to create a Virtual Network and also to create a Virtual Machine.

Let’s understand a few basic things about Load Balancer!

Load Balancer on Azure

Azure Load Balancer is a scalable Software Load Balancer. There are two versions the External for Internet based traffic and the Internal for Private Traffic. Load Balancer can balance upto 100 virtual machines. It supports TCP or UDP protocols and comes up with Health Probes of TCP and HTTP.

Functions of Load Balancer

Start creating a Virtual Machine using the below steps

Step 1

Start creating a Virtual Machine of Windows Server 2012 R2 Datacenter. Look for my previous articles to learn about the "Basics" blade of creating a Virtual Machine.

Step 2

Select the size for the Virtual Machine which has to be created.

Step 3

On the "Settings" blade, configure for the storage account.

Azure

Select the Virtual Network of one which was created in the previous demo.

Azure

Configure the Network Security Group (NSG), select the NSG which was created in the previous demo.

Azure

Enable "Guest monitoring" and click on OK to pass for the next blade.

Azure

Pass the "Summary" blade and purchase the new Virtual Machine of Windows Server.

Step 4

Click on "Connect" to connect with the Virtual Machine now.

Azure

Save the downloadable RDP file and open it with the help of Remote Desktop Connection.

Azure

Click on "Connect" again in the RDP popup box and connect with the Virtual Machine.

Azure

Enter the credentials for the Virtual Machine to get connected.

Azure

Step 5

Connect with both the Server machines and install IIS using the below Powershell commands using Powershell.

Add-windowsfeature –name “web-server”

Azure

Open the IIS HTML file from your C drive’s program files of both the Virtual Machine and add some lines on HTML file to represent the difference.

Location of HTML file could be – c/inetpub/wwwroot.iis.html

Save the HTML file on both of the Virtual Machine which has been created and close the same.

Azure

Creating a Load Balancer to connect with the Server Machine.

Step 6

Move to the Azure portal and search for Load Balancer on it. Click on "Create".

Azure

Step 7

Add a back-end pool towards the Load Balancer which has been created.

Azure

  1. Name the back-end pool.
  2. Select the IP version of the backend pool for IPV4.
  3. Associated to the Availability Set which was configured on the previous demo.
  4. Specify the availability sets over here.
  5. Add another target IP network configuration.
  6. Select the new Virtual Machine for target.
  7. Specify the Network IP configuration.
  8. Click on "OK" to add the Back-end pool.

    Azure

Step 8

Add Health Probes over here. Click on "Add" to add the health probes.

Azure

Step 9

Adding Load Balancer Rules.

Azure

Now, here we will be getting a Public IP address on the Overview blade.

Azure

Click on the Public IP address or either copy and paste it on a new tab of the browser. We can find that the application gets accessed from both the servers alternatively depending on the load.

In this below image, the application gets accessed from Server 1.

Azure

Now, when we refresh the page, the application gets accessed from the another server machine of 2.

Azure