...

/

Project: Azure Load Balancers

Project: Azure Load Balancers

Learn how to configure an Azure Load Balancer in this lesson.

Azure load balancer

An Azure load balancer consists of three components: the frontend IP address configuration, the backend IP pool, and the load balancer itself. You’ll see that each of these components needs a name in the below given code snippet.

  • Frontend IP address configuration called NoBSAzureLb-LbFeIP.

  • Backend IP address pool called NoBSAzureLb-AddrPool.

  • An Azure Load Balancer called NoBSAzureLb-Lb.

Note the names used here are not mandatory. You may use any name you’d like.

Each of these components comes together to create a Basic load balancer. The command below could create a Standard SKU too, which provides more advanced functionality, but it is not needed for this project.

$lbName = "$projectName-Lb"
$lbFeIp = "$projectName-LbFeIp"
$lbAddrPool = "$projectName-AddrPool"
az network lb create `
    --name $lbName `
    --public-ip-address $pipName `
    --sku Basic `
    --frontend-ip-name $lbFeIp `
    --backend-pool-name $lbAddrPool

Health probe

When the project is complete, the load balancer needs a place to send web traffic to. For this project, that traffic will go to a VM availability set with three VMs. To ensure the website remains functional at all times, the load balancer must know how to determine if a VM is functional or not. The load balancer needs to know if each VM is “healthy” or serving up a web page. ...