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.
Join the conversation! Your thoughts help the community grow.