App Gateway provisioning failed despite healthy status. Error: ApplicationGatewayErrorApplyingConfiguration.

RahulChauhan-0151 0 Reputation points
2026-11-18T22:41:24.2633333+00:00

Subject: Azure Application Gateway WAF_v2 Provisioning Failure

An Azure Application Gateway (WAF_v2) is Running and Resource Health shows Available, but its provisioning state remains Failed.

Multiple configuration updates fail with ApplicationGatewayErrorApplyingConfiguration, including attempts to reapply the existing configuration.

Subnet provisioning is successful, with no NSG or custom UDRs. Existing listeners and routing rules remain configured.

Has anyone experienced this issue? What could cause configuration updates to fail while the gateway remains healthy, and what is the recommended recovery approach without disrupting existing services?

Azure Application Gateway
Azure Application Gateway

An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.

0 comments No comments

2 answers

Sort by: Oldest
  1. AI answer

    2026-11-18T22:42:46.5033333+00:00

    The safest recovery is to leave the running WAF_v2 gateway in place, identify and correct the first failed control-plane operation, and only then issue a new configuration PUT to restore provisioningState to Succeeded.

    Resource Health: Available and operationalState: Running can coexist with provisioningState: Failed: the latter records that the most recent management-plane update failed, while the existing deployed configuration can continue serving traffic.^1^

    1. Find the original failure

    In the Azure portal:

    1. Open Application Gateway → Activity log.
    2. Filter:
      • Resource: the affected gateway
      • Status: Failed
      • Time range: when the first update failed
    3. Open the first failed operation, not the later reapply attempts; later failures can be cascading effects.
    4. In JSON, record:
      • statusMessage
      • error code and detailed message
      • correlationId
      • operation timestamp
    5. Check Change history for changes made approximately 30 minutes before or after that operation.^2^

    A read-only CLI check can confirm that the data-plane and control-plane states differ:

    az network application-gateway show \
      --name "<gateway-name>" \
      --resource-group "<resource-group>" \
      --subscription "<subscription-id>" \
      --query "{provisioningState:provisioningState,
                operationalState:operationalState,
                sku:sku.tier}" \
      --output json
    

    If it reports operationalState: Running with provisioningState: Failed, do not stop or delete the gateway while investigating. Neither action is required to repair the failed provisioning metadata.

    2. Correct the condition named in statusMessage

    Because the subnet has no NSG or custom UDR, those common causes do not need to be revisited unless the Activity Log explicitly reports a subnet or routing error. Concentrate on the error returned by the first failed operation:

    • ApplicationGatewayKeyVaultSecretException or LinkedAccessCheckFailed
      Check that the gateway’s user-assigned identity still exists and has secret Get access; the referenced vault, certificate, and secret still exist and are enabled; and Key Vault firewall/private-endpoint DNS configuration permits resolution and access.^2^
    • InvalidResourceReference, or InternalServerError naming a listener, path map, backend pool, or HTTP setting
      Look for an orphaned reference—for example, a routing rule that still points to an object removed by an earlier deployment. Recreate the missing object or update the dependent configuration together in one deployment.^3^
    • AuthorizationFailed, ScopeLocked, or OperationNotAllowed
      Correct the reported RBAC or resource-lock condition. Application Gateway troubleshooting requires appropriate write permissions; subnet changes additionally require network permissions.^3^
    • Generic Internal Server Error with no actionable component
      Do not keep submitting configuration changes. Escalate with the timestamp and correlationId from the failed Activity Log event.^2^

    3. Reapply only after correcting the cause

    Since reapplying the unchanged configuration has already failed, repeating it before addressing the original error is unlikely to recover the gateway. After the underlying condition is corrected, issue a full Get-and-Set PUT:

    Connect-AzAccount
    
    $gateway = Get-AzApplicationGateway `
      -Name "<gateway-name>" `
      -ResourceGroupName "<resource-group>"
    
    $gateway | Set-AzApplicationGateway
    

    Review pending configuration before running this write operation. Always retrieve the current object first: running Set-AzApplicationGateway without Get-AzApplicationGateway, or using an older API/tool, can overwrite settings with defaults or omit properties.^1^

    Then rerun the CLI state query. The expected result is:

    • provisioningState: Succeeded
    • operationalState: Running

    A no-op PUT often clears a transient failed state, but if it returns to Failed, Microsoft’s guidance is to treat the current configuration or one of its dependencies as invalid rather than repeatedly retrying.^4^

    4. Escalation criteria

    Open an Azure support request without stopping or recreating the gateway when:

    • the detailed error remains only ApplicationGatewayErrorApplyingConfiguration or InternalServerError;
    • no invalid dependency is identified;
    • the corrected configuration PUT still fails; or
    • the resource remains Updating for an extended period.

    Include the first failed operation’s timestamp, correlationId, full statusMessage, gateway resource ID, region, and confirmation that existing traffic remains operational.


    References

    1. Troubleshoot Azure Microsoft.Network failed provisioning state
    2. Troubleshoot Failed state issues on Azure Application Gateway
    3. Troubleshoot Application Gateway deployment, scaling, and deletion failures
    4. Troubleshoot HTTP 502 errors in Azure Application Gateway
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. VIVEK DWIVEDI 270 Reputation points Microsoft Employee
    2026-11-19T13:52:11.63+00:00

    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

    1. Go to Application Gateway > Activity log.
    2. Filter on your gateway, Status = Failed, and the time window when this started.
    3. Open the oldest failed event, not the latest one. Your re-apply attempts are just repeating the original failure.
    4. Switch to JSON view and look at statusMessage under Properties. Note the correlationId and the timestamp as well.
    5. 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.net is 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.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.