Create a Standard Load Balancer with zonal frontend using Azure PowerShell

This article steps through creating a public Standard Load Balancer with a zonal frontend using a Public IP Standard address. To understand how availability zones work with Standard Load Balancer, see Standard Load Balancer and Availability zones.

If you don't have an Azure subscription, create a free account before you begin.

Note

Support for Availability Zones is available for select Azure resources and regions, and VM size families. For more information on how to get started, and which Azure resources, regions, and VM size families you can try availability zones with, see Overview of Availability Zones. For support, you can reach out on StackOverflow or open an Azure support ticket.

Note

This article has been updated to use the new Azure PowerShell Az module. You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. For Az module installation instructions, see Install Azure PowerShell.

Log in to Azure

Log in to your Azure subscription with the Connect-AzAccount command and follow the on-screen directions.

Connect-AzAccount

Create resource group

Create a Resource Group using the following command:

New-AzResourceGroup -Name myResourceGroupZLB -Location westeurope

Create a public IP Standard

Create a Public IP Standard using the following command:

$publicIp = New-AzPublicIpAddress -ResourceGroupName myResourceGroupZLB -Name 'myPublicIPZonal' `
  -Location westeurope -AllocationMethod Static -Sku Standard -zone 1

Create a front-end IP configuration for the website

Create a frontend IP configuration using the following command:

$feip = New-AzLoadBalancerFrontendIpConfig -Name 'myFrontEnd' -PublicIpAddress $publicIp

Create the back-end address pool

Create a backend address pool using the following command:

$bepool = New-AzLoadBalancerBackendAddressPoolConfig -Name 'myBackEndPool'

Create a load balancer probe on port 80

Create a health probe on port 80 for the load balancer using the following command:

$probe = New-AzLoadBalancerProbeConfig -Name 'myHealthProbe' -Protocol Http -Port 80 `
  -RequestPath / -IntervalInSeconds 360 -ProbeCount 5

Create a load balancer rule

Create a load balancer rule using the following command:

   $rule = New-AzLoadBalancerRuleConfig -Name HTTP -FrontendIpConfiguration $feip -BackendAddressPool  $bepool -Probe $probe -Protocol Tcp -FrontendPort 80 -BackendPort 80

Create a load balancer

Create a Standard Load Balancer using the following command:

$lb = New-AzLoadBalancer -ResourceGroupName myResourceGroupZLB -Name 'MyLoadBalancer' -Location westeurope `
  -FrontendIpConfiguration $feip -BackendAddressPool $bepool `
  -Probe $probe -LoadBalancingRule $rule -Sku Standard

Next steps