Create a Load-Balanced Set of Internet Facing Azure Virtual Machines Using the New Azure Portal

loadbalancing

I was working with someone the other day on setting up internet facing load-balancing between two existing Virtual Machines (VMs) in Azure and for a number of reasons they wanted to use the Azure portal to do so. After a thorough search for a guide on the process, I realized that no such guide exists and so I created one.

 

Prerequisites:

  • All VMs which are to be added to the load-balanced set must already exist
  • All VMs which are to be added to the load-balanced set must be in the same virtual network and in the same subnet
  • All VMs which are to be added to the load-balanced set must be under the same domain name ({yourchosenname}.cloudapp.net)

If you have not already created these VMs, then you may replace STEP 1 (below) with this creation guide, except incorporate the remaining steps at the settings stage for the creation guide.

 

STEP 1:

Click on ‘All Resources’ then find and click on one of the VMs you wish to have in the load-balanced set, this will open the information blade as well as the settings blade for the VM.

step 1

 

STEP 2:

Under the ‘Settings Blade’ scroll down, click on ‘Load-Balanced Set’, then click ‘Join’

step 2

 

STEP 3:

Click on ‘Load-Balanced Set: Configure required settings’

step 3

 

STEP 4: 

Click on ‘Create a load balanced set’, then input a name, public port, and probe port for the load-balanced set.  The probe port does not need to be the same as the public port, but you will get a warning if it is not (I recommend that it be the same).  Then click OK.

step 4

 

STEP 5:

After you click OK in the previous step, it will take you back to the blade below.  Here I forgot to select public or internal for the load-balanced set, so click on ‘Public’, then click OK.

step 5

 

STEP 6:

Now you will need to wait for the load-balanced set to be created, you can see the progress by clicking on the notifications tab and it will also show up in the blade as see below

step 6

 

STEP 7:

By going to the Endpoints on the VM, you will see that the process has created a load-balanced endpoint.

step 7

STEP 8:

Now we need to add a second VM to this load-balanced set, so go back to ‘All Resources’ and select the other VM, then go back through the same process as before, except instead of creating a new load-balanced set, you will be using an existing set.  NOTE:  you will need to click OK for the unsaved edits being discarded, this is for the ‘create a load-balanced set’ blade that opens by default, but we are not using it.

step 8

STEP 9:

Click OK

step 9

STEP 10:

Again, you will need to wait for the operation to complete

step 10

 

STEP 11:

You can check that the endpoint is created, just like the previous VM

step 11

 

Conclusion

Now that those steps are complete, requests will be load balanced between the two VMs on the configured port (443 in this case). NOTE: The application on the VM must be able to handle being load balanced.

 

Leave a Reply