An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
Hello Mall Ashi,
Yes, you can absolutely host an Azure Application Gateway in Subscription X (with a public IP / custom domain) and route traffic to an Azure Kubernetes Service (AKS) cluster residing in Subscription Y.
Here is a breakdown of how this architecture works, how to configure it, and the supporting Microsoft documentation.
1. How It Works (Network Connectivity)
Azure Application Gateway communicates with its backend targets over Layer 7 using Private IP addresses or FQDNs. As long as there is network route connectivity between the two Virtual Networks across the subscriptions, Application Gateway can reach the AKS pods or internal load balancer.
You have two primary ways to set up this cross-subscription topology:
Option A: Virtual Network (VNet) Peering (Most Common & Recommended)
- Peering: Establish a VNet Peering connection between VNet A (Subscription X - App Gateway) and VNet B (Subscription Y - AKS). Cross-subscription and cross-region VNet peering are fully supported in Azure.
- Backend Target:
- With Azure CNI: App Gateway can route directly to AKS Pod private IPs.
- With Kubenet / Internal Load Balancer: App Gateway routes to the internal Kubernetes Service
LoadBalancerIP / Ingress Controller IP inside the AKS VNet.
- Public Access: The Application Gateway uses its Public Frontend IP with your custom domain (and SSL certificate), while the backend communication to AKS remains completely private and secure over the peered VNet backbone.
Option B: Application Gateway Ingress Controller (AGIC) Multi-Cluster / Cross-Subscription
If you are using the Application Gateway Ingress Controller (AGIC):
- AGIC running as a pod in Subscription Y can update the Application Gateway in Subscription X, provided the AKS Managed Identity / Service Principal has the Contributor or Network Contributor role assigned on the Application Gateway resource in Subscription X.
2. Key Prerequisites & Routing Checklist
- Non-overlapping IP Ranges: Ensure the address spaces of the VNet in Subscription X and the VNet in Subscription Y do not overlap.
- Network Security Groups (NSGs): Allow inbound traffic from the Application Gateway subnet IP range to the AKS subnet on the application ports (e.g., 80, 443, 8080).
- DNS / Custom Domain: Bind your custom domain name to the Frontend Public IP of the Application Gateway in Subscription X.
3. Official Microsoft Documentation References
- Virtual Network Peering across subscriptions: Virtual network peering - Azure Virtual Network
- Application Gateway Backend Pool configuration (Cross-VNet targets): Application Gateway components and backend routing
- Set up AGIC with existing Application Gateway (including cross-VNet/Sub topologies): Install Application Gateway Ingress Controller using an existing Application Gateway
Hope this confirms your design! Let us know if you need specific guidance on the AGIC permissions or peering configuration.