Friday, August 28, 2026

Azure: Bicep template for load balancer

 The following Bicep template deploys a load balancer in Azure. It has two front-end IPs and two back-end pools with each two pre-allocated IPs. It can be deployed before any back-end resources are deployed. Once the back-end resources are deployed with the correct IPs, they will be automatically added in the pool.

It has a health probe that listens on port 80 and two load balancing rules that connects each of the front-end IPs with the respective back-end pool.

This LB setup can be used for various scenarios, one is for firewall appliances such as Palo Alto where you typically have two FWs running each with two interfaces for traffic (and an additional one for management traffic) and then an LB in front to manage traffic to the two appliances.

Loadbalancer.bicep

Loadbalancer.parameters.json