Azure Application Gateway is often used when an application needs HTTP and HTTPS routing, TLS termination, Web Application Firewall capabilities, host-based routing, path-based routing, and backend health monitoring.
The challenge appears when the application should remain completely private.
A common assumption is that making an Application Gateway private means giving up the Layer 7 features that make Application Gateway useful. That is not the case. You can design an Application Gateway with private frontend connectivity while still performing HTTP-aware routing between clients and backend applications.
The important part is understanding the difference between the frontend address, backend connectivity, DNS, routing, and security controls.
A private Application Gateway is not simply an Application Gateway with a public IP removed. The surrounding network architecture must also be designed so that clients can resolve, reach, and securely communicate with the private frontend.
This article explains how to keep an Azure Application Gateway private while retaining Layer 7 routing, how the traffic path works, and what to check when private application access does not behave as expected.
What Is Azure Application Gateway?
Azure Application Gateway is a Layer 7 application delivery service.
Layer 7 means that the gateway understands application protocols such as HTTP and HTTPS rather than treating traffic only as raw IP packets.
For example, a network-level load balancer may primarily make decisions using information such as:
Source IP
Destination IP
Protocol
PortApplication Gateway can make routing decisions using HTTP information such as:
Host name
URL path
HTTP headers
TLS configuration
Backend healthThat allows a single gateway to route traffic to different applications.
For example:
Client
|
v
Application Gateway
|
+---- api.example.com → API backend
|
+---- portal.example.com → Portal backend
|
+---- reports.example.com → Reports backendThis Layer 7 capability remains useful even when the gateway itself is private.
What Does a Private Application Gateway Mean?
A private Application Gateway uses a private frontend IP address rather than exposing the application entry point through the public internet.
A simplified architecture looks like this:
Private Client
|
v
Private DNS
|
v
Private IP
|
v
Application Gateway
|
v
Backend ApplicationThe client needs private network connectivity to the subnet where the gateway's frontend is available.
That connectivity could come from:
The same Azure VNet
VNet peering
VPN
ExpressRoute
Another approved private connectivity architecture
The key point is that the client reaches the gateway through private networking.
Private Frontend Does Not Remove Layer 7 Routing
This is the most important concept.
The frontend being private and the routing logic being Layer 7 are separate concerns.
For example:
Private client
|
| HTTPS
v
Private Application Gateway
|
+---- Host: api.internal.example.com
| |
| v
| API backend
|
+---- Host: portal.internal.example.com
|
v
Portal backendThe gateway can still inspect the HTTP request and select the appropriate backend.
The fact that the client reached the gateway through a private IP does not prevent Layer 7 routing.
Why Use a Private Application Gateway?
Private Application Gateway is useful when applications should be reachable only from trusted networks.
Typical examples include:
Internal enterprise applications
Private APIs
Administrative portals
Internal dashboards
Back-office systems
Applications used by corporate users
Internal Kubernetes applications
Private microservices
Applications exposed through private connectivity to another VNet
The architecture avoids making the application publicly reachable simply because it needs HTTP routing.
For example:
Internet
|
X
|
Private Application Gateway
|
v
Internal ApplicationInstead:
Corporate Network
|
v
Private Connectivity
|
v
Application Gateway
|
v
Internal ApplicationFrontend and Backend Are Different
One of the easiest ways to understand Application Gateway is to separate its frontend from its backend.
The frontend is where clients connect.
The backend is where Application Gateway sends traffic after making its routing decision.
For example:
Client
|
| HTTPS
v
Frontend IP
|
v
Application Gateway
|
| HTTP/HTTPS
v
Backend pool
|
v
ApplicationMaking the frontend private does not mean that the backend must use the same network address.
The gateway can have private connectivity to backend resources while presenting a private frontend to clients.
This separation allows the gateway to act as a controlled application entry point.
The Network Placement Matters
Application Gateway is deployed into an Azure subnet.
That subnet becomes an important part of the architecture.
A simplified VNet might look like:
Azure VNet
|
+-- Application Gateway Subnet
| |
| +-- Private Application Gateway
|
+-- Application Subnet
| |
| +-- Backend Application
|
+-- Private DNS / supporting servicesThe exact subnet structure depends on the environment and Azure requirements.
The important design principle is to keep the gateway and application networking organized so that routing and security rules are easy to understand.
Do not treat the Application Gateway subnet like an ordinary application subnet.
Private DNS Is Essential
Suppose the application is available at:
portal.internal.example.comA client must resolve this hostname to the private Application Gateway frontend.
The expected flow is:
portal.internal.example.com
|
v
Private DNS
|
v
10.20.10.20
|
v
Application GatewayIf DNS instead returns a public IP, the client may attempt to access the application through the internet path.
If DNS returns the wrong private IP, the client may reach another environment.
If DNS cannot resolve the name, the client may fail before any Azure Application Gateway troubleshooting begins.
For this reason, private DNS should be considered part of the application architecture, not an afterthought.
Split-Horizon DNS
Organizations often want the same hostname to work differently depending on where the client is located.
For example:
Internal client
|
v
portal.example.com
|
v
Private IPAn external client might receive:
portal.example.com
|
v
Public IPThis approach is useful when an application has both internal and external access requirements.
However, if the application is intended to be completely private, avoid maintaining an unnecessary public endpoint simply because the DNS name is shared.
The important question is:
"Which networks should be able to resolve and reach this application?"
That answer should drive the DNS architecture.
Host-Based Routing With a Private Gateway
One of the biggest benefits of keeping Application Gateway private is that you do not lose host-based routing.
Imagine an enterprise environment with:
hr.internal.example.com
finance.internal.example.com
inventory.internal.example.comAll three names can resolve to the same private Application Gateway frontend.
The gateway then routes requests based on the Host header.
Conceptually:
Private Application Gateway
|
+-- hr.internal.example.com
| |
| v
| HR Application
|
+-- finance.internal.example.com
| |
| v
| Finance Application
|
+-- inventory.internal.example.com
|
v
InventoryThis provides centralized application routing without exposing the gateway publicly.
Path-Based Routing
Private Application Gateway can also route requests based on URL paths.
For example:
internal.example.com/orders
internal.example.com/customers
internal.example.com/reportsThe gateway can direct each path to an appropriate backend.
A simplified routing structure is:
internal.example.com
|
+-- /orders
| |
| v
| Orders API
|
+-- /customers
| |
| v
| Customer API
|
+-- /reports
|
v
Reports APIThis can be useful when several internal services share a common application hostname.
However, path-based routing can require additional application configuration.
Check how the backend handles:
URL prefixes
Redirects
Absolute URLs
Static content
Cookies
API documentation
Authentication callbacks
TLS Termination
Application Gateway can terminate HTTPS connections before forwarding traffic to the backend.
The architecture might look like:
Client
|
HTTPS
|
Private Application Gateway
|
HTTP
|
BackendOr HTTPS can continue to the backend:
Client
|
HTTPS
|
Private Application Gateway
|
HTTPS
|
BackendThe second approach provides encryption between the gateway and backend as well.
Which model is appropriate depends on the security requirements.
For sensitive internal applications, encrypting traffic beyond the gateway may be desirable even though both systems are inside the same VNet.
Certificate Management
When Application Gateway handles HTTPS, certificate management becomes part of the architecture.
The gateway needs to present a certificate that matches the hostname used by clients.
For example:
Client requests:
finance.internal.example.com
Certificate must cover:
finance.internal.example.comIf the certificate does not match, clients may report TLS errors even though network connectivity is working.
When troubleshooting HTTPS, separate the problem into:
DNS
↓
Network connectivity
↓
TCP connection
↓
TLS handshake
↓
HTTP routing
↓
Backend responseThis layered approach prevents certificate problems from being confused with routing problems.
Backend Pools
Application Gateway sends requests to backend pools.
A backend pool might contain:
Virtual machines
Virtual machine scale sets
Private IP addresses
App Service resources
Kubernetes-related endpoints
Other supported backend targets
The gateway does not simply forward traffic to anything that responds.
It uses its configured backend settings and health probes to determine whether a backend is available.
For example:
Application Gateway
|
v
Backend Pool
|
+-- Server 1 → Healthy
|
+-- Server 2 → Healthy
|
+-- Server 3 → UnhealthyTraffic can then be routed according to the gateway configuration.
Health Probes Matter
A private Application Gateway can have a healthy frontend but unhealthy backends.
This creates a common troubleshooting situation:
Client
|
v
Private IP
|
v
Gateway responds
|
X
Backend unavailableThe client may receive errors such as 502 or another gateway-level response.
When this happens, check the backend health rather than immediately changing DNS or network rules.
Verify:
Probe protocol
Probe hostname
Probe path
Probe port
Expected status code
Backend listener
Backend network connectivity
The health probe should test something that represents actual application readiness.
Host Headers Can Cause Problems
Some backend applications expect a specific Host header.
For example, the gateway may receive:
Host: portal.internal.example.combut the backend application may expect:
Host: backend.internal.localIf the gateway's backend settings do not handle this correctly, the backend may return an error even though the network connection works.
This is particularly important with:
Web servers
Multi-tenant applications
Frameworks that validate hostnames
Applications using virtual hosts
Authentication systems
Always test the complete HTTP request path rather than only testing whether the backend IP is reachable.
Private Application Gateway and AKS
Application Gateway is often used in front of Azure Kubernetes Service applications.
A simplified architecture is:
Private Client
|
v
Private Application Gateway
|
v
AKS Ingress
|
v
Kubernetes Service
|
v
PodsThe gateway provides the Azure-side application entry point.
The Kubernetes ingress layer handles application routing inside the cluster.
This can be useful when an organization wants Azure-native traffic management while keeping the Kubernetes workloads private.
However, it introduces another layer that must be monitored.
A request can fail at:
Client
↓
DNS
↓
Application Gateway
↓
Ingress
↓
Service
↓
PodTroubleshooting should follow the same order.
Private Access From Another VNet
Suppose Application Gateway is deployed in VNet A and the client application is deployed in VNet B.
The architecture may look like:
VNet A
|
+-- Private Application Gateway
|
|
+--------- VNet Peering ---------
|
|
VNet B
|
+-- Client ApplicationThe client needs:
DNS resolution
Route to the private frontend
Network security permission
Return route
Correct port access
VNet peering by itself does not guarantee that every traffic path is valid.
Always test the actual route.
Private Access From On-Premises
Enterprise environments may also expose the private gateway to on-premises clients.
For example:
Corporate Network
|
v
ExpressRoute / VPN
|
v
Azure VNet
|
v
Private Application Gateway
|
v
ApplicationThe private gateway can therefore serve as an internal application entry point for employees and corporate systems.
The network team must ensure that the private IP range is advertised or routed correctly to the corporate environment.
DNS must also return the private address to those clients.
Network Security Rules
Private Application Gateway should not be treated as automatically trusted simply because it has a private IP.
Restrict network access to the gateway based on the actual client requirements.
For example:
Corporate subnet
|
| TCP 443
v
Application Gatewaymay be allowed.
But:
Every VNet
|
| TCP 443
v
Application Gatewaymay be unnecessarily broad.
Review:
Source networks
Destination subnet
Destination port
Required protocols
Network security groups
Azure Firewall policies
Route tables
Network security should reinforce the application's intended access model.
Web Application Firewall
A private Application Gateway can still be useful when Web Application Firewall capabilities are required.
The security architecture can therefore be:
Private Client
|
v
Private Application Gateway + WAF
|
v
Backend ApplicationThe application does not need to be public simply because WAF functionality is required.
This can be useful for internal applications that still need protection against application-layer attacks.
However, WAF rules should be tested against the application's actual behavior.
Internal applications can still generate false positives when they use:
Complex JSON
File uploads
Special URL parameters
Unusual headers
Custom API formats
Troubleshooting Private Application Gateway
Use a layered approach.
Step 1: Verify DNS
Confirm the hostname resolves to the expected private frontend IP.
nslookup app.internal.example.comStep 2: Verify Network Connectivity
Confirm that the client can reach the private IP over the expected port.
Check:
VNet connectivity
VNet peering
VPN
ExpressRoute
Network security groups
Azure Firewall
Route tables
Step 3: Check Gateway Listener
Verify:
Frontend IP
Frontend port
HTTPS configuration
Certificate
Hostname
Listener state
Step 4: Check Routing Rules
Verify that the incoming hostname or path matches the expected rule.
For example:
api.internal.example.com
|
v
API backend
portal.internal.example.com
|
v
Portal backendStep 5: Check Backend Health
If the gateway is reachable but requests fail, check backend health.
Step 6: Check Backend Connectivity
Confirm that the gateway can reach the backend on the configured port.
Step 7: Check Application Logs
Only after the network and gateway layers are verified should you move deeper into application debugging.
This avoids wasting time investigating application code when the actual failure is a route or listener configuration.
Common Mistakes
Removing the Public IP but Forgetting DNS
Clients may still attempt to use the old public address.
Treating Private as Automatically Secure
A private IP reduces exposure but does not replace authorization or network controls.
Ignoring Backend Health
A healthy gateway does not mean the application behind it is healthy.
Incorrect Hostname Configuration
A listener, certificate, routing rule, or backend may expect a different hostname.
Incorrect TLS Configuration
The certificate may not match the hostname requested by the client.
Forgetting Return Routing
The client may reach the gateway while the response path fails.
Making the Gateway Subnet Too Open
Private infrastructure should still have controlled access.
Testing Only From One Network
An application that works from the same VNet may fail from an on-premises network or another peered VNet.
Production Checklist
Before keeping an Azure Application Gateway private, verify:
Private frontend architecture is defined.
Gateway subnet is correctly configured.
Private IP address is assigned as expected.
Private DNS is configured.
Required clients resolve the correct private hostname.
VNet routing is configured.
VNet peering is validated where required.
VPN or ExpressRoute routing is validated where required.
Network security rules are reviewed.
HTTPS listeners are configured.
Certificates match the application hostnames.
Backend pools are configured correctly.
Backend health probes are working.
Host-based routing is tested.
Path-based routing is tested where applicable.
Backend Host header behavior is verified.
TLS termination is documented.
Backend encryption requirements are documented.
WAF rules are tested if WAF is enabled.
Application authentication remains enabled.
Gateway logs are available.
Backend application logs are available.
Failure scenarios are tested.
No unnecessary public endpoint remains.
Advantages and Disadvantages
Advantages
A private Application Gateway provides:
Private application entry points
Layer 7 routing
Host-based routing
Path-based routing
HTTPS termination
Backend health monitoring
Centralized application traffic management
Integration with private Azure networking
Optional WAF protection
Disadvantages
The architecture also introduces additional operational requirements:
Private DNS must be maintained.
Routing becomes more complex.
Gateway and backend health must be monitored separately.
TLS certificates require management.
Cross-VNet and on-premises connectivity needs explicit configuration.
Troubleshooting spans multiple network layers.
The additional complexity is reasonable when the application needs Layer 7 routing but should not be publicly exposed.
Summary
Keeping Azure Application Gateway private does not mean giving up Layer 7 routing.
The gateway can continue to make decisions based on hostnames, URL paths, HTTPS configuration, backend health, and other application-level information while clients reach it through private network connectivity.
The key is to design the complete path:
Client
↓
Private DNS
↓
Private IP
↓
Application Gateway
↓
Backend routing
↓
ApplicationDNS determines where the client connects. Azure networking determines whether that private address is reachable. Application Gateway handles Layer 7 routing and backend selection. Network security controls determine which clients are permitted to connect.
When these layers are configured together, internal applications can retain the benefits of Application Gateway without requiring a public frontend.
The most important operational practice is to troubleshoot the architecture from the outside in. Check DNS first, then routing, then the gateway listener and routing rules, then backend health, and finally the application. This makes private Application Gateway deployments much easier to operate and diagnose in production.

Join the conversation! Your thoughts help the community grow.