Share via

Application Gateway for Containers association fails after traffic controller succeeds on AKS

John Jones 0 Reputation points
2026-05-14T03:42:24.0066667+00:00

I am deploying Application Gateway for Containers on AKS.

The AKS cluster is configured with:

Azure CNI Overlay

Workload Identity enabled

Gateway API / ALB add-on enabled

ApplicationLoadBalancer custom resource

Ingress API with ingressClassName: azure-alb-external

The Kubernetes resources appear to be accepted. The ingress points to the intended ALB resource:

annotations:

alb.networking.azure.io/alb-name: <alb-resource-name>

alb.networking.azure.io/alb-namespace: <alb-namespace>

spec:

ingressClassName: azure-alb-external

The ApplicationLoadBalancer resource points to a dedicated delegated subnet:

apiVersion: alb.networking.azure.io/v1

kind: ApplicationLoadBalancer

metadata:

name: <alb-resource-name>

namespace: <alb-namespace>

spec:

associations:

  - /subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Network/virtualNetworks/<vnet-name>/subnets/<alb-subnet-name>

The subnet is:

CIDR: /24

Delegation: Microsoft.ServiceNetworking/trafficControllers

ProvisioningState: Succeeded

The ALB managed identity has Network Contributor on that subnet.

Azure successfully creates the traffic controller:

Microsoft.ServiceNetworking/trafficControllers/<traffic-controller-name>

ProvisioningState: Succeeded

But the association fails:

Microsoft.ServiceNetworking/trafficControllers/<traffic-controller-name>/associations/<association-name>

ProvisioningState: Failed

Because the association fails, the Kubernetes ingress never receives an address:

kubectl get ingress

NAME CLASS ADDRESS

<ingress-name> azure-alb-external <blank>

The ingress events show it is accepted:

Normal Accepted Application Gateway for Containers

I also tried recreating the ApplicationLoadBalancer using a new clean /24 delegated subnet. The new traffic controller was created successfully, but the new subnet

association also failed.

In both attempts, Azure partially attached Microsoft-managed APPGW IP configurations to the delegated subnet, then the association entered Failed.

Attempts to delete the failed association or traffic controller return:

InternalServerError

Microsoft.ServiceNetworking/trafficControllers/associations/delete

Microsoft.ServiceNetworking/trafficControllers/delete

Azure Application Gateway
Azure Application Gateway

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


2 answers

Sort by: Most helpful
  1. John Jones 0 Reputation points
    2026-05-15T08:53:41.9533333+00:00

    The issue now seems to be even worse when I am trying to delete the whole deployment with terraform it seems everything else is getting stuck because of this.
    Below is the error that terraform produced as a result of the not being able to delete the alb subnet:

    Can you guys clear the below resource from the Azure side?

    Error: deleting Subnet

    Resource Group Name: "<aks-resource-group>"

    Virtual Network Name: "<vnet-name>"

    Subnet Name: "<alb-subnet-name>"

    performing Delete: unexpected status 400 (400 Bad Request) with error:

    InUseSubnetCannotBeDeleted:

    Subnet <alb-subnet-name> is in use by:

    /subscriptions/<microsoft-managed-subscription-id>/resourceGroups/<microsoft-managed-resource-group>/providers/Microsoft.Network/networkInterfaces/<microsoft-managed-

    appgw-nic>/ipConfigurations/<ipconfig-name>

    and cannot be deleted.

    In order to delete the subnet, delete all the resources within the subnet.

    See aka.ms/deletesubnet.

    This subnet was used for Application Gateway for Containers. The AGC association failed, but Microsoft-managed APPGW NIC/IP configuration references remain attached to

    the delegated subnet. The referenced NIC is in a Microsoft-managed subscription/resource group that I cannot access, so I cannot delete it directly.

    Was this answer helpful?

    0 comments No comments

  2. Venkatesan S 8,490 Reputation points Microsoft External Staff Moderator
    2026-05-14T06:47:42.3866667+00:00

    Hi @ John Jones,

    Thank you for reaching out to Microsoft Q&A.

    Thanks for providing the detailed scenario and error details. The generic InternalServerError during provisioning of Application Gateway for Containers (AGC) is unfortunately quite common and usually occurs deep in the data-plane when Azure tries to inject the managed proxies into the delegated subnet.

    As discussed, the issue occurs only when creating the Application Gateway for Containers and associating the subnet via Terraform. When the same configuration is created through the Azure portal, it completes successfully without any issues.

    Please review your Terraform code and Kubernetes objects. Additionally, since another Application Gateway for Containers is working fine with Terraform, comparing both configurations may help identify the difference.

    Kindly let us know if the above helps or you need further assistance on this issue.

    Please “Accept Answer” wherever the information provided helps you, this can be beneficial to other community members.

    Was this answer helpful?


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.