PSHarriJaakkonen:~/Blog/Posts>cat ./az-700-part-07-application-gateway-front-door.html

AZ-700 Part 7: Application Gateway and Azure Front Door

AZ-700 Part 7: Application Gateway and Azure Front Door

Back to AZ-700 index

Application Gateway

Application Gateway is a regional layer 7 load balancer for HTTP and HTTPS workloads. It supports path-based routing, host-based routing, TLS termination, end-to-end TLS, cookie affinity, custom probes, rewrite rules, redirects, autoscale, and WAF.

Application Gateway Objects

ObjectPurpose
Frontend IPPublic or private address clients connect to.
ListenerProtocol, port, hostname, and certificate binding.
Backend poolTargets such as VMs, VMSS, App Service, or IP/FQDN backends.
HTTP settingsBackend protocol, port, timeout, cookie affinity, host name, and probe association.
Health probeDetermines backend health.
RuleConnects listener to backend pool and HTTP settings.

Application Gateway Troubleshooting

  • Backend unhealthy often means probe path, host header, certificate, NSG, UDR, or backend service mismatch.
  • For App Service backends, host name override and trusted root certificates can matter.
  • For end-to-end TLS, validate backend certificate trust and SNI behavior.
  • For WAF blocks, check diagnostic logs and rule IDs before creating exclusions.

Azure Front Door

Azure Front Door is a global HTTP/HTTPS application delivery service. It runs at Microsoft edge locations and provides global routing, acceleration, TLS termination, end-to-end TLS, caching, rules, URL rewrite, URL redirect, WAF, and origin health probing.

Front Door Standard vs Premium

RequirementLikely tier
Global HTTP routing, custom domains, TLS, caching, WAFStandard or Premium
Private Link to originsPremium
Advanced security and private origin patternsPremium

Front Door Configuration

  • Endpoint: public hostname at the edge.
  • Origin group: set of origins and health-probe behavior.
  • Origin: backend service such as App Service, Application Gateway, storage, or custom origin.
  • Route: maps domains and paths to origin groups.
  • Rule set: modifies requests or responses with redirects, rewrites, headers, or caching behavior.
  • WAF policy: protects against HTTP attacks at the edge.

Decision Table

RequirementUse
Regional path-based routing to private VM backendsApplication Gateway
Global active-active HTTP deliveryAzure Front Door
Protect global app at the edgeFront Door WAF
Protect regional app behind VNetApplication Gateway WAF
Keep origin private through Microsoft backboneFront Door Premium with Private Link origin, where supported

Lab

  1. Create Application Gateway with HTTPS listener, backend pool, and custom health probe.
  2. Create a path-based rule with two backends.
  3. Create Front Door with two origins and priority routing.
  4. Add a WAF policy in detection mode, then switch to prevention after testing.

Feature Deep Dive

TLS Termination vs End-to-End TLS

TLS termination means the client TLS session ends at Application Gateway or Front Door. End-to-end TLS means the connection from the gateway or edge service to the backend is also encrypted. The exam may ask for certificate placement, backend trust, SNI, or compliance requirements that require encryption all the way to the origin.

Host Header and SNI

Many backend services expect a specific hostname. If Application Gateway probes the backend using the wrong host header, the backend can be marked unhealthy. If TLS SNI does not match the certificate, HTTPS backends can fail even though the network path is open.

Rewrite and Redirect Rules

Redirects tell the client to make a new request to a different URL. Rewrites modify the request or response while keeping the proxy flow. Use redirects for HTTP-to-HTTPS or domain moves. Use rewrites for header changes, path adjustments, or backend compatibility.

Front Door Origin Protection

Front Door is public at the edge, but the origin does not have to be broadly public. You can restrict origin access to Front Door traffic and, with Premium where supported, connect to origins through Private Link. This is a major design answer for global delivery with private origin access.

Application Gateway vs Front Door

CapabilityApplication GatewayAzure Front Door
ScopeRegionalGlobal edge
BackendsRegional private or public backendsOrigins across regions and services
Private backend patternVNet-integrated regional backendPrivate Link origin with Premium where supported
Best forRegional layer 7 routingGlobal acceleration, WAF, and failover

Scenario Workshop: Backend Health Is Red

Scenario: Application Gateway shows all backends as unhealthy after enabling HTTPS to the backend. Users receive 502 errors. The likely cause is not routing first; it is often backend HTTP settings, SNI, certificate trust, or probe configuration.

CheckWhy it matters
Backend HTTP setting protocol and portThe gateway must use the same protocol and port the backend expects.
Host name overrideMany backends require a specific host header.
SNIBackend TLS certificate selection can depend on the hostname sent by SNI.
Trusted root certificateApplication Gateway must trust the backend certificate chain.
Probe pathThe health endpoint must return a healthy response.

Front Door Request Flow

  1. Client resolves the Front Door endpoint or custom domain.
  2. Client connects to the closest Microsoft edge location.
  3. Front Door evaluates WAF policy, route, rules engine, cache, and origin group health.
  4. Front Door selects an origin based on routing and health.
  5. Front Door connects to the origin over HTTP or HTTPS, optionally using Private Link where configured.
  6. The response returns through the edge, where caching and response header rules can apply.

Design Rules

  • Use Front Door when the entry point must be global.
  • Use Application Gateway when the entry point is regional and tightly coupled to a VNet.
  • Use WAF policy at the layer where the application is exposed.
  • Do not use Traffic Manager when the requirement says TLS termination, WAF, URL rewrite, or acceleration.
  • For private origins behind Front Door, check Premium and Private Link support.

Previous | Next: Part 8 - Private Access to Azure Services