In this post, let’s try to create a public load balancer. This would help to understand few concepts like health probe, backend pools, load balancer front end etc. In future posts, we will try to load balance the virtual machines.
Refer Azure Load Balancer – Create availability set for creating virtual network and two virtual machines within an availability set.
Create load balancer
To create a new public load balancer, search Load Balancer in top menu search box and then select Load Balancers from the search results. It would open the list showing all existing load balancers. Then click on Add to create new one.
On the create new load balancer, provide below inputs:
- Subscription, a valid Azure subscription
- Resource Group, the logical container for load balancer
- Name, the name for load balancer resource
- Region, the geographical region where the resource should be created
- Type, either
- SKU, the pricing tier.
Standardtier is recommended for production. For this demo, select
- Public IP address, create a new IP address
- Public IP address name, name for the public IP address name
- Public IP address SKU, the pricing tier for public IP address
- IP address assignment, keep this to default, i.e.
Then, click on Review + Create button. If all inputs are valid, Create button to create the resource.
Once the load balancer is created, some other resources should also be created. Those resources are:
- Load balancer settings for a backend address pool.
- A health probe.
- A load balancer rule.
Create a backend pool
Now, navigate to the newly created load balancer. Select Backend pools Under Settings, then select Add.
On the Add a backend pool page, provide below inputs:
- Name, provide vm-backend, as the name for your backend pool
- Virtual network, select the
demo-vnetthat you already have created (refer Prerequisite section).
- IP version, select
- Associated to, select
- Virtual Machines, add the two virtual machines
demo-vm2which are part of
Once these inputs are provided, then click on Add button. This would add the backend.
Create a health probe
The load balancer monitors the status of your app with a health probe.
The health probe adds or removes VMs from the load balancer based on their response to health checks.
We are going to create a health probe, which sends a health check message after every 15 seconds, and if there are two consecutive health checks fail.
In next post, we will create the rule for load balancer. I hope you found this information useful. Let me know your thoughts.