connect application gateway for containers to frontdoor

Biswajit Sahu 25 Reputation points
2025-07-30T14:51:03.1633333+00:00

Hi,

Could you please help me understand how to integrate Application Gateway for Containers with Azure Front Door?

I tried setting the origin type as "Custom" in Azure Front Door and provided the frontend URL obtained after deploying the gateway and HTTPRoute from Application Gateway for Containers. However, I'm encountering the following error:

"Azure Front Door wasn't able to connect to the origin."

I would greatly appreciate your guidance on resolving this issue.

Thanks

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
{count} votes

Accepted answer
  1. Ravi Varma Mudduluru 85 Reputation points Microsoft External Staff Moderator
    2025-08-05T13:55:45.37+00:00

    Hello @Biswajit Sahu,

    Hope you're doing well!

    Thank you for your patience and time. Please find below the detailed step-by-step instructions for the setup.

    I have set up the configuration using only the HTTP route. If you want to enable HTTPS, you need to add the TLS/SSL certificates in Azure Front Door. Additionally, you must configure HTTPS listeners in the gateway.yaml file on the AKS cluster, as demonstrated in Step 8. Only then will HTTPS requests be handled properly.

    Step 1: Creating an AKS Cluster Using Azure Portal

    Please refer to the document below for setting up an AKS cluster.
    https://learn.microsoft.com/en-us/azure/aks/learn/quick-kubernetes-deploy-portal?tabs=azure-cli

    Step 2: Create a Subnet for Application Gateway for Containers (AGC)

    Next, we need to create a dedicated subnet that will be used by AGC. This subnet must be delegated to the correct Azure service to enable integration.

    1. In the Azure portal, navigate to Virtual Networks and select the VNet you used while creating the AKS cluster.
    2. Go to the Subnets section and click  “+ Subnet” to add a new one.
    3. Enter the following details:
    • Name: subnet-alb
      • Address range: 10.0.1.0/24
      • Subnet delegation: Choose Microsoft.ServiceNetworking/trafficControllers

    Refer to the screenshot below for a visual reference:

    User's image

    1. Click Save to create the subnet.

    Note: Delegating the subnet is a required step for AGC to function properly. Without it, the controller won't be able to provision network resources.

    Step 3: Create a User-Assigned Managed Identity for AGC

    To do this securely, we assign it a user-assigned managed identity. This identity is then granted specific IAM roles so it can perform only the actions it needs — following least privilege principles.  

    The Application Gateway for Containers (AGC) controller requires a managed identity to authenticate securely with Azure resources.

    1. In the Azure portal, search for Managed Identities and click “+ Create”.
    2. Provide the required details:
    • Resource Group: Use the same one you used for your AKS cluster (e.g., myRG01).
      • Region: Choose the same region as your AKS cluster.
      • Name: Give the identity a clear name, such as alb-identity.

    Refer to the screenshot below for a visual reference:

    User's image

    1. Click Review + Create to provision the identity.

    Once the managed identity is created:

    • Navigate to its Overview section.
    • Copy the Client ID and Object ID — you will need these later when installing the AGC (ALB) controller via Helm.

    Refer to the screenshot below for a visual reference:

    User's image

    Tip: It is a good practice to store the Client ID and Object ID somewhere safe for quick reference during the setup.

    Step 4: Assign IAM Roles to the Managed Identity

     To allow the AGC controller to configure and access network resources, we need to assign the required IAM roles to the managed identity created in the previous step.

    Assign Role on the Resource Group:

    1. Go to the Resource Group used for your AKS and AGC resources (e.g., myRG01).
    2. Navigate to Access Control (IAM) and click “+ Add > Add role assignment”.
    3. Choose the following:
    • RoleApp Gateway for Containers Configuration Manager
    • Assign access toManaged Identity
    • Select: Choose the managed identity you created earlier in Step 3 (e.g., alb-identity).
      • Click Review + Create to provision the Role Assignment

    Refer to the screenshot below for a visual reference:User's image

    User's image

    Assign Role on the Subnet:

    1. Now go to the Virtual Network, and then open the Subnets section.
    2. Select the subnet created for AGC (e.g., subnet-alb).
    3. Click on Access Control (IAM)Add role assignment.
    4. Use the following:
    • RoleNetwork Contributor
      • Assign access toManaged Identity
        • Select: Choose the same identity (alb-identity).
          • Click Review + Create to provision the Role Assignment

    Refer to the screenshot below for a visual reference:User's image

    User's image

    User's image

     Note: These roles allow the AGC controller to manage traffic routing and network configuration within the designated subnet.

    Step 5: Add a Federated Credential to the Managed Identity

     To allow the AGC controller running in AKS to securely authenticate as the managed identity, we’ll configure a federated credential.

    1. Go to the Managed Identity you created earlier (e.g., alb-identity).
    2. In the left-hand menu, select Federated credentials, then click “+ Add”.
    3. Choose the following settings:
    • ScenarioKubernetes accessing Azure resources
      • Cluster Issuer URL : (Ex:[https://oidc.prod-aks.azure.com/<unique-id>/)]") - You will get it in AKS cluster (AKS--> Security Configurations --> OIDC --> Issuer URL)
        • Namespace: azure-alb-system
          • Service Account: alb-controller-sa
            • Name: federated-alb

    Refer to the screenshot below for a visual reference:

     User's image

    User's image

    1. Click Save to create the trust relationship.

     

    Tip: This setup links the controller's Kubernetes identity to Azure AD using OIDC federation — allowing it to use the assigned roles without managing credentials.

     

    Connect to AKS using Azure Cloud Shell

    1. In the Azure Portal, navigate to your AKS Cluster → Click “Connect” from the top menu.
    2. In the "Connect to AKS" panel, choose the Cloud Shell tab.
    3. Click “Open Cloud Shell” – this will automatically open a terminal at the bottom of the portal.
    4. The required commands will be auto-populated. You can simply copy and run them to authenticate and configure access:

    Refer to the screenshot below for a visual reference:User's image

    Installation Steps :

    1) Get AKS Cluster Credentials

     First, connect your local CLI to the AKS cluster using the following command. Replace the placeholders with your actual values:

     
    az aks get-credentials  --resource-group <your-resource-group>  --name <your-aks-cluster-name>
    

    This command downloads the cluster config so that you can interact with AKS using kubectl.

    2) Register Resource Providers & Enable Extensions

    Make sure your subscription includes the necessary Azure resource providers and the alb CLI extension:

    az provider register --namespace Microsoft.ContainerService 
    az provider register --namespace Microsoft.Network 
    az provider register --namespace Microsoft.ServiceNetworking
    az extension add --name alb
    

     Output: No stable version of 'alb' to install. Preview versions allowed

    The installed extension 'alb' is in preview

    This is normal and expected. The alb CLI extension for managing Application Gateway for Containers (AGC) is still in preview, and Azure shows this notice by default.

    Your command was successful, the extension is now installed correctly.

    3. Install the ALB Controller from the OCI Helm Chart

    Next, install the AGC (ALB) controller using the official OCI-based Helm chart from Microsoft:

    helm install alb-controller oci://mcr.microsoft.com/application-lb/charts/alb-controller \
    --version 1.0.0 \
    --namespace azure-alb-system \
    --create-namespace \
    --set albController.podIdentity.clientID=<your-managed-identity-client-id>
    

    Replace <your-managed-identity-client-id> with the "Client ID" of the managed identity you created earlier(e.g., alb-identity). You can find this in the (Managed Identity --> Overview --> Client) in the Azure portal.

     4. Verify the ALB Controller is Running

    After the Helm installation, run the following command to verify that the ALB controller pods are up and running:

     kubectl get pods -n azure-alb-system
    

     You should see output similar to this:

     
    alb-bootstrap-xxxxxxxx    Running
    alb-controller-xxxxxxxx    Running
    

    This confirms that the AGC controller has been deployed successfully into your AKS cluster.

    Refer to the screenshot below for a visual reference:User's image

    5. Confirm Deployment & Component Status

    kubectl get pods -n azure-alb-system
    

     

    You should see:

    • alb-controller pods (typically 2 replicas)
    • alb-bootstrap pod  

    Also validate the GatewayClass:

     kubectl get gatewayclass azure-alb-external
    
    
    1. Run to verify:
     kubectl get pods -n azure-alb-system -l app=alb-controller
    
    
    

    Refer to the screenshot below for a visual reference:User's image

    to be continued in the comments to follow..

    Kindly let us know if the above helps or you need further assistance on this issue. Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


0 additional answers

Sort by: Most helpful

Your answer

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