Coder Perfect

During AKS provisioning, Application Gateway: ResourceNotFound (bicep)

Problem

When we use bicep to deploy our environment with AKS and Application Gateway, we occasionally encounter the following issue during AKS provisioning:

{
    "status": "Failed",
    "error": {
        "code": "ResourceNotFound",
        "message": "The Resource 'Microsoft.Network/applicationGateways/xxx-agw' under resource group 'xxx-rg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"
    }
}

The Application Gateway is created in the same bicep file as the AKS, and it is referenced in the AKS’s bicep code as follows:

    addonProfiles: {
      ingressApplicationGateway: {
        enabled: true
        config: {
          applicationGatewayId: applicationGateway.id
          effectiveApplicationGatewayId: applicationGateway.id
        }
      }

Everything works when we run the bicep file again. Is this a matter of time, or did I overlook something?

Thanks, Peter

Asked by Peter Wyss

Solution #1

Wyss, Peter Could you perhaps give more source code so that I can better grasp the problem?

Thank you very much, bmoore-MSFT. Adding your suggestion as a response to assist other members of the community.

The ResourceNotFound problem could be fixed by doing the following:

Resource Not Found (dependsOn is not functioning), Resolve resource not found errors, and submit a GitHub issue at Resource Not Found (dependsOn is not working).

Answered by DeepDave-MT

Post is based on https://stackoverflow.com/questions/68676961/application-gateway-resourcenotfound-during-aks-provisioning-bicep