An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
Hi RahulChauhan-0151
First, the good news: your gateway isn’t actually broken. “Running” and “Available” describe the data plane, which is still serving traffic with the last configuration that applied successfully. “Failed” only refers to the provisioning state, which means the last ARM update didn’t go through. So please don’t stop, delete or redeploy the gateway. You don’t need to, and you’d only cause an outage.
ApplicationGatewayErrorApplyingConfiguration is a wrapper error. The real reason is underneath it, so that’s what we need to find.
Step 1: Find the first failure
- Go to Application Gateway > Activity log.
- Filter on your gateway, Status = Failed, and the time window when this started.
- Open the oldest failed event, not the latest one. Your re-apply attempts are just repeating the original failure.
- Switch to JSON view and look at
statusMessageunder Properties. Note thecorrelationIdand the timestamp as well. - The Change history tab is worth a look too. It shows what changed in the 30 minutes either side of the failure.
Step 2: Fix whatever statusMessage points to
On WAF_v2, I’ve usually seen it come down to one of these:
- Key Vault certificate access (ApplicationGatewayKeyVaultSecretException)
- The user-assigned identity on the gateway still exists and has Get permission on secrets
- The vault, certificate and secret haven’t been deleted or soft-deleted, and are enabled
- If Key Vault uses a private endpoint, check that
privatelink.vaultcore.azure.netis linked to the gateway’s VNet and the A record is still correct. A stale A record left behind after a private endpoint is recreated catches a lot of people out. - If Key Vault uses service endpoints, the App Gateway subnet must be allowed in the vault firewall
- A reference to something that’s gone: a rule, listener, path map, backend pool, HTTP setting or WAF policy pointing to an object that was deleted earlier
- WAF policy: check that the associated policy still exists and isn’t in a failed state itself
- Permissions or locks: AuthorizationFailed or ScopeLocked means an RBAC or resource lock problem
Step 3: Push the config again
Re-applying will keep failing until the underlying issue is fixed. Once it is, do a normal get-and-set:
$gw = Get-AzApplicationGateway -Name "<gateway-name>" -ResourceGroupName "<rg>"
Set-AzApplicationGateway -ApplicationGateway $gw
Afterwards, provisioning state should be back to Succeeded, with the gateway still Running.Let me know how it goes and please UPVOTE the answer if it works.