Skip to main content
emnode
Site Reliability

Enable Application Gateway autoscale and health probes

One capability across capacity and routing: make sure the gateway in front of your application scales with demand, runs more than one instance, and steers traffic away from backends that are failing, so a traffic spike or a single dead node never becomes an outage.

14 min·10 sections·AZURE

Last reviewed

Autoscale and health probes: the basics

What does a fragile Application Gateway actually look like?

Application Gateway is the layer-7 load balancer that sits in front of your web application and decides which backend each request reaches. Fragility shows up in a handful of distinct shapes rather than one setting. A v2 gateway can be pinned to a fixed instance count, so a traffic spike saturates the capacity you happened to provision and requests start queuing or failing. It can be running on a single instance, which leaves no headroom if that instance is being updated or restarts, and which falls outside the availability SLA. And it can route on backend pool membership alone, with no meaningful health probe, so when one backend goes bad the gateway keeps sending real users to it.

Azure Advisor turns each of these into its own reliability recommendation, which is why one gateway can fail several reliability checks at once. 'Enable autoscaling', 'Use two or more instances of Application Gateway' and 'Use an Application Gateway health probe' are the three that close the widest gaps, and they form a single capability. They read as separate problems on the Advisor blade, but they are one job: make the front door scale with load, survive the loss of any single instance, and stop sending traffic to a backend that cannot serve it.

Most of this fragility is drift, not intent. A gateway created with a fixed capacity during a proof of concept that nobody revisited, a module that never set an autoscale range, a default probe left in place because the application worked on the day it shipped. The work is to find every gateway that cannot absorb a spike or survive a failure, switch it to autoscale with a sensible minimum and maximum, ensure it runs at least two instances, and give it a probe that actually reflects whether the backend is healthy.

In this lesson you will learn how Application Gateway v2 expresses capacity and backend health, how to find every fragile gateway in a subscription, and how to make them scale and self-heal without taking a live service offline. The lesson walks the three Advisor reliability recommendations in this capability, autoscale, instance count and health probes, and shows the exact check and a copy-and-paste fix for each.

Fun fact

The instance you never knew you had

Even when the Azure portal shows an autoscaling Application Gateway v2 with a minimum capacity of zero, the service always keeps two instances running internally to provide high availability and to handle the first burst of traffic while it scales out. The catch is the SLA: to be eligible for the availability commitment, the gateway must be configured to autoscale or be zone redundant, and run with at least two instances doing your load balancing. So the platform quietly gives you a second instance for resilience, but you only get the SLA that goes with it once you have configured the gateway to earn it.

Finding fragile gateways across a subscription

Priya is the platform lead at a scale-up whose checkout sits behind an Application Gateway that was provisioned during the original migration and never revisited. Azure Advisor shows reliability findings on three gateways across two subscriptions, all created before the team adopted its current Bicep modules.

Rather than work the findings one by one, Priya starts by listing which gateways are pinned to a fixed capacity instead of autoscaling, so the genuinely under-provisioned front doors can be separated from drift before anything changes.

Start by listing the v2 gateways and whether each one autoscales. A gateway with no autoscale range is pinned to a fixed instance count and cannot absorb a spike.

$ az network application-gateway list --query "[?sku.tier=='Standard_v2' || sku.tier=='WAF_v2'].{name:name, fixedCapacity:sku.capacity, autoscaleMin:autoscaleConfiguration.minCapacity}" -o table
Name FixedCapacity AutoscaleMin
---------------- --------------- ------------
checkout-agw 1
internal-agw 2
web-agw 2
# checkout-agw is pinned to a SINGLE fixed instance: no autoscale, no SLA. Fix it first.

A gateway with a fixed capacity and no autoscale minimum cannot grow under load. A fixed capacity of one also sits outside the availability SLA. Fix these first.

How Advisor decides a gateway is fragiledeep dive

Most gateway reliability recommendations resolve to one of three properties on the resource. The first is capacity mode: a v2 gateway with a fixed 'sku.capacity' is pinned, while one with an 'autoscaleConfiguration' holding a 'minCapacity' and 'maxCapacity' scales between those bounds as load changes. The second is the instance count: to be eligible for the availability SLA, the gateway must run at least two instances and be configured to autoscale or be zone redundant. The third is the backend probe: with only a default probe, the gateway checks little more than that the backend answers at all, whereas a custom probe with a real path, interval, timeout and unhealthy threshold reflects whether the application is genuinely healthy.

Probe behaviour matters more than it looks. Every instance of the gateway probes each backend independently and on the same schedule, so with a 30 second interval and two instances each backend sees a probe from each instance every 30 seconds. The unhealthy threshold is the number of consecutive failed probes before the gateway marks a backend down and stops sending it traffic; the default of three is deliberate, so a single transient blip does not eject a healthy server. Set the path to an endpoint that genuinely exercises the application, not a static file that returns 200 even when the app behind it is broken.

Advisor evaluates these reliability signals on a periodic cycle, so a fix does not flip the recommendation to resolved instantly. The control-plane change itself is immediate, and a gateway switched to autoscale begins scaling at once, but the Advisor posture catches up on the next assessment. The strongest position combines the per-gateway settings with a Bicep module or Azure Policy that bakes autoscale, a two-instance minimum and a real probe into every new gateway, so no future deployment ships a fragile front door.

What is the impact of leaving a gateway fragile?

The direct impact is downtime. A fixed-capacity gateway has a hard ceiling: once traffic exceeds the instances you provisioned, requests queue and then fail, and a sale, a launch or a viral moment becomes an outage at the worst possible time. A single-instance gateway has no headroom for the routine events that happen anyway, a platform update, a restart, an unlucky fault, and falls outside the availability SLA while it is exposed. The overwhelming majority of these incidents were avoidable: a gateway that could have scaled or failed over was simply never configured to.

The second-order impact is that a missing or shallow health probe turns one bad backend into a user-facing error. Without a probe that reflects real application health, the gateway keeps load-balancing traffic onto a node that is returning errors or hanging, so a fault that should have been invisible, one unhealthy instance out of several, becomes a stream of failed requests for whichever users land on it. A good probe contains the blast radius of a single failure to nothing the user ever sees.

On the resilience side, this capability is what stands behind any availability target you have promised, internally or to customers. An estate where every customer-facing gateway autoscales, runs at least two instances and probes its backends is the difference between an availability number you can defend and one you are quietly hoping holds. It is also the cheapest, most direct lever you have on the reliability of everything sitting behind the front door.

How do you make a gateway resilient safely?

Work the capability as one loop rather than chasing individual findings. The order matters: get capacity and instance count right before you tighten probes, so you are not ejecting backends from a gateway that has no headroom to absorb the rerouted load.

1. Inventory every gateway by resilience

List the v2 gateways that are pinned to a fixed capacity, that run a single instance, and that have no custom backend probe. Treat this inventory as the source of truth, not the Advisor finding count, because one gateway can trigger several recommendations at once.

2. Prioritise by cost of downtime, not by finding

Most fragility is unintended drift, but not all gateways matter equally. For each one, decide what an hour of outage behind it would actually cost. A gateway fronting checkout or a customer-facing portal is a different priority from one fronting an internal admin tool, even though both raise the same finding.

3. Switch to autoscale with at least two instances

Move each gateway from a fixed capacity to an autoscale range with a minimum of at least two, so it sits inside the availability SLA and has headroom for routine load, and a maximum that covers your realistic peak. The change takes effect immediately and the gateway begins scaling at once.

4. Give it a probe that reflects real health, then bake it in

Add a custom health probe that hits an endpoint genuinely exercising the application, with a sensible interval, timeout and an unhealthy threshold of at least three to avoid flapping on transient blips. Then bake autoscale, the two-instance minimum and the probe into your Bicep module so every new gateway ships resilient by default rather than relying on someone remembering.

# 1. Switch a fixed-capacity gateway to autoscale with a two-instance floor.
#    Min 2 keeps it inside the availability SLA; max covers your realistic peak.
az network application-gateway update \
  --resource-group rg-edge \
  --name checkout-agw \
  --min-capacity 2 \
  --max-capacity 10

# 2. Add a custom health probe that reflects real application health.
#    --threshold 3 avoids ejecting a backend on a single transient blip.
az network application-gateway probe create \
  --resource-group rg-edge \
  --gateway-name checkout-agw \
  --name checkout-health \
  --protocol Https \
  --host contoso.example.com \
  --path /healthz \
  --interval 30 \
  --timeout 30 \
  --threshold 3

Quick quiz

Question 1 of 5

Advisor shows reliability findings on a gateway across autoscale, instance count and health probes. What is the most efficient way to think about them?

You can now treat Application Gateway resilience as one capability rather than a scatter of findings: inventory which gateways cannot scale or survive a failure, prioritise by the cost of downtime behind each one, switch them to autoscale with at least two instances, give them a probe that reflects real health, and bake all three into your deployment pipeline so no new gateway ships fragile. The front door scales with demand, survives the loss of any single instance, and routes around a failed backend on its own.

Back to the library