Azure Front Door: The Complete Guide

Azure Front Door: The Complete Guide

A friendly, in-depth tour of Microsoft's global entry point for web applications. Learn how it speeds up websites, spreads traffic across regions, blocks attacks, and keeps your app reachable when parts of the world go wrong.

Imagine you own a restaurant in one city, and customers from all over the world want to order your food. If every order must travel to your single kitchen, far-away customers wait a long time, and if a storm closes the road to your kitchen, nobody gets dinner. Now imagine you open small pickup counters in hundreds of cities. Each counter greets the customer nearby, checks the order, hands over popular items that are already prepared, and sends only the special orders to the real kitchen along a fast private road. If one kitchen shuts, the counters quietly send orders to another kitchen.

Azure Front Door is that network of pickup counters for web applications. It sits in front of your websites and APIs, greets visitors close to where they live, and takes care of speed, safety, and reliability on your behalf. In this guide you will learn what it is, how its pieces fit together, how a request travels through it, how it chooses between your servers, how it protects you from attacks, and how to run it well in production. Every new term is explained when it first appears, and every big idea comes with an everyday comparison.

Global
Entry points near users worldwide
Layer 7
Understands web requests, not just packets
2 tiers
Standard and Premium

1What Is Azure Front Door?

A global, cloud-based front gate for web traffic, run by Microsoft on its own worldwide network.

Starting with how websites are reached

When you type a website name into a browser, your device asks a system called DNS (the Domain Name System) for the numeric address that belongs to that name. DNS works like a phone book for the internet. Your browser then connects to that address, asks for a page using a language called HTTP, and receives the answer. When the page is private or secure, the conversation is wrapped in encryption called TLS, which is what puts the padlock in the address bar.

The computers that actually hold your website and your application logic are called origins (some people say “back ends” or “origin servers”). An origin might be an Azure App Service, a virtual machine, a container app, a storage account serving static files, or even a server in your own office or another cloud.

What Front Door adds

Without Front Door, every visitor connects straight to your origin. If the origin is in Europe and the visitor is in Australia, every message takes a long trip, and the origin must handle every connection and every attack by itself. Azure Front Door places a smart layer between visitors and origins. Visitors connect to a Front Door location close to them. Front Door then talks to your origins on their behalf using Microsoft’s private global network.

In technical words, Azure Front Door is a global, Layer 7 load balancer, application delivery network, and web application firewall platform. “Layer 7” means it understands the actual web request: the website name, the path, the headers, and cookies. That is why it can make decisions like “send everything under /images to the storage account and everything under /api to the application servers”.

Everyday analogy

Think of a large airport’s arrivals hall. Travelers do not walk straight into the city. They pass through a hall where staff check documents, point people to the right exit, and keep unsafe visitors out. Front Door is the arrivals hall for your application, and Microsoft has built one near almost every major population center.

The main jobs it does

Speed

Accelerate

Ends encrypted connections near the visitor, reuses fast connections to your origin, and serves cached copies of popular content.

Direction

Route

Sends each request to the best healthy origin, using rules based on website name, path, and more.

Safety

Protect

Filters attacks with a web application firewall, absorbs floods of traffic, and manages certificates for secure connections.

Reliability

Survive failures

Watches origin health and quietly shifts traffic away from broken or distant regions.

A short history

Content delivery networks, or CDNs, grew popular in the early 2000s as a way to place copies of images and videos near readers. Microsoft built its own global edge network to serve products such as Microsoft 365 and Xbox, then opened that technology to customers as Azure Front Door around 2019. Later, Microsoft merged ideas from Azure CDN and Front Door into newer Standard and Premium tiers, and has been moving customers away from the older “classic” versions. Always check Microsoft’s official notices for exact retirement dates of older products.

i
Remember

Front Door works with web traffic, meaning HTTP and HTTPS. It is not meant for databases, mail servers, or other non-web protocols.

2Front Door and Its Neighbors: Choosing the Right Tool

Azure offers several traffic-routing services. They sound alike, so knowing the differences prevents expensive wrong turns.

Azure has four commonly confused services for moving traffic. Each works at a different level and a different distance from the user.

flowchart TD
    U["Users around the world"] --> TM["Traffic Manager: DNS based routing"]
    U --> AFD["Front Door: global HTTP and HTTPS edge"]
    AFD --> AG["Application Gateway: regional web load balancer"]
    AG --> LB["Load Balancer: regional network level distribution"]
    LB --> VM["Virtual machines and apps"]
    AFD --> APP["App Service, storage, container apps"]
    
FIG 2.1 — Where each traffic service usually sits
ServiceScopeWorks atBest for
Azure Front DoorGlobalWeb requests (Layer 7)Fast, secure, resilient global web apps and APIs
Traffic ManagerGlobalDNS answersSteering any kind of traffic by name lookups
Application GatewayOne regionWeb requests (Layer 7)Routing and firewalling inside a region or virtual network
Load BalancerOne regionNetwork connections (Layer 4)Spreading raw TCP or UDP traffic

Understanding the differences

Traffic Manager only answers DNS questions. It says “go to this address”, and then the visitor connects directly. It never touches the traffic itself, so it cannot cache, cannot filter attacks, and cannot speed up connections. Because answers are cached by devices around the internet, failover can be slow.

Application Gateway understands web requests like Front Door does, but it lives in one region, usually inside your own virtual network. It is a great local traffic cop and local firewall. Load Balancer is simpler still. It spreads connections without reading web content.

Everyday analogy

Traffic Manager is a road sign that says “turn left for the northern kitchen”. Front Door is a greeter who walks the guest inside, checks the order, and carries it to the right kitchen. Application Gateway is the head waiter inside one restaurant. Load Balancer is the person who simply points guests to the next free table.

i
They work together

A very common design places Front Door at the global edge, then Application Gateway or a regional load balancer inside each region. The services are layers of one design, not rivals.

What about a normal CDN?

A CDN focuses on caching static files such as images, scripts, and videos. Front Door includes that caching ability, but it also adds smart routing between origins, health checking, a web application firewall, and handling of dynamic content such as API calls. If you need only simple static delivery, a CDN may be enough. If you need an entire global entry point, Front Door is the fuller answer.

3Core Concepts You Must Know

A handful of building blocks appear in every Front Door setup. Learn their names and jobs and the rest becomes easy.

Profile

A profile is the container for one Front Door setup. It holds your endpoints, origin groups, routes, rule sets, and security policies. You pick the tier (Standard or Premium) at the profile level.

Endpoint

An endpoint is a public name that Front Door gives you, ending in a Front Door domain. Visitors reach your application through it. You usually place your own friendly name, such as www.yourcompany.com, in front of it using a custom domain.

Custom domain

A custom domain is your own website name attached to an endpoint. Front Door can create and renew a managed certificate for it automatically, so the padlock works without you buying or installing anything. You can also bring your own certificate, stored safely in Azure Key Vault.

Origin and origin group

An origin is one back-end server or service. An origin group is a set of origins that can do the same job, for example the same application deployed in West Europe and in East US. Inside the group you set the health check rules and the load-balancing behavior.

Route

A route is the instruction that connects a visitor’s request to an origin group. It says which domains and which paths it applies to, which protocols are allowed, whether to cache, and which rule sets to apply. Think of it as one line in the airport signboard: “Flights to Paris, use gate 12”.

Rule set

A rule set is a collection of small if-then actions, such as “if the path starts with /old, redirect to /new” or “add this header to every response”. You attach rule sets to routes.

WAF policy and security policy

A web application firewall policy (WAF policy) holds the rules that detect and block malicious requests. A security policy attaches that WAF policy to chosen domains. Section by section, this guide will return to this idea in the security chapter.

flowchart TD
    P["Front Door profile"] --> EP["Endpoint"]
    P --> OG["Origin group with health probe"]
    P --> RS["Rule sets"]
    P --> SP["Security policy with WAF policy"]
    EP --> CD["Custom domain with certificate"]
    EP --> R["Route"]
    R --> OG
    R --> RS
    OG --> O1["Origin one"]
    OG --> O2["Origin two"]
    SP -.-> CD
    
FIG 3.1 — How the pieces of a Front Door profile connect
Everyday analogy

The profile is the whole airport. An endpoint is one terminal entrance. A custom domain is the airline name painted above the desk. Origins are the aircraft, an origin group is a fleet of similar aircraft, routes are the signboard lines, rule sets are the small rules of the desk staff, and the WAF is airport security.

!
Common confusion

A route connects to an origin group, not to a single origin. To send traffic to one server only, create a group that contains just that server.

4Tiers: Standard, Premium and the Classic Past

Pick the tier by the protection and private connectivity you need, since you pay for the difference.

Tier 1

Standard

Content delivery plus global routing, health checks, custom domains with managed certificates, rule sets, and custom firewall rules. A good fit for most public websites and APIs.

Tier 2

Premium

Everything in Standard plus security extras: managed firewall rule sets, bot protection, and the ability to reach origins privately using Private Link. Built for sensitive and regulated workloads.

Older

Classic

The earlier generation of Front Door and Azure CDN from Microsoft. Microsoft has announced retirement and encourages migration, so avoid it for new projects.

Rule of thumb

Start with the need

If you need managed attack rules, bot filtering, or private origins, choose Premium. Otherwise Standard often does the job at a lower price.

CapabilityStandardPremium
Global routing and health probesYesYes
Caching and compressionYesYes
Managed certificatesYesYes
Custom firewall rulesYesYes
Managed firewall rule sets and bot protectionNoYes
Private Link to originsNoYes
Typical priceLower base feeHigher base fee
i
Check current details

Feature lists, limits, and prices change over time. Use this table to understand the shape of the choice, then confirm exact capabilities and costs on Microsoft’s official pages before you decide.

How tier choice affects design

Standard works well when your origins are public web services protected by simple rules, such as limiting access by country or rate. Premium becomes attractive when you want your origins to have no public address at all, reachable only through a private connection from Front Door, and when you want Microsoft-maintained rules to catch common attacks without writing them yourself.

5The Edge Network: Anycast and Points of Presence

The magic of “close to the visitor” comes from how addresses and cables are arranged.

Points of presence

Microsoft operates a large number of edge locations, also called points of presence or PoPs, in cities all over the world. Each one is a small group of powerful servers connected to local internet providers and to Microsoft’s private backbone. When a visitor reaches Front Door, they land on the nearest edge location, not on a faraway data center.

Anycast: one address, many places

Normally an address belongs to one place. With anycast, the same address is announced from many locations at once. The internet’s own routing system then carries each visitor’s traffic to the closest announcing location. So visitors in Mumbai and visitors in Madrid both connect to “the same” Front Door address, yet each lands in a different building near them.

Everyday analogy

Think of a pizza chain with one national phone number. When you call, the phone network quietly connects you to the shop nearest your home. You never needed to know the local number.

The private backbone

After the edge location, traffic does not wander over the public internet to your origin. It rides Microsoft’s own global fiber network, which has fewer crowded paths, fewer unpredictable delays, and fewer dropped packets. The public internet is used for only the short first hop from the visitor, and sometimes for the last hop to an origin outside Azure.

flowchart LR
    V1["Visitor in Asia"] --> E1["Nearby edge location"]
    V2["Visitor in Europe"] --> E2["Nearby edge location"]
    V3["Visitor in Americas"] --> E3["Nearby edge location"]
    E1 --> BB["Microsoft private global backbone"]
    E2 --> BB
    E3 --> BB
    BB --> OA["Origin in Europe region"]
    BB --> OB["Origin in US region"]
    
FIG 5.1 — Short public hop, long private ride

Why this matters for speed

Setting up a secure connection takes several back-and-forth messages between visitor and server. Each message crosses the distance once. If the server is on another continent, those messages cost a lot of waiting. If the first server is only a few milliseconds away, the setup finishes quickly. Front Door finishes this setup at the edge, then reuses a long-lived, already-warm connection to your origin. This is the heart of why pages feel faster.

i
Even uncacheable content gets faster

A common surprise: pages that cannot be cached, such as personalized dashboards or API calls, still often load faster through Front Door, because the slow connection setup is done close to the visitor and the long haul rides a better network.

6Architecture and Components

The internal layout, seen from a distance, with the control side and the traffic side kept apart.

Front Door has two sides that never get mixed. The control plane is where you and Azure tools create and change your settings. The data plane is the fleet of edge servers that carry real visitor traffic. Keeping them separate means a busy day on the management side does not slow visitors, and a configuration change can be pushed out to all edge locations safely.

flowchart TD
    ADM["You using portal, templates or command line"] --> CP["Control plane: validate and store configuration"]
    CP --> DIST["Configuration distribution to all edge locations"]
    DIST --> E1["Edge server group A"]
    DIST --> E2["Edge server group B"]
    VIS["Visitors"] --> E1
    VIS --> E2
    E1 --> WAF["WAF and routing engine"]
    E2 --> WAF
    WAF --> CACHE["Edge cache"]
    CACHE --> ORG["Origins"]
    E1 --> LOG["Logs and metrics"]
    E2 --> LOG
    
FIG 6.1 — Control plane on top, data plane carrying traffic below
1

Configuration store

Holds your profile settings. When you save a change, it is validated and then queued for distribution.

2

Distribution

The new settings travel to every edge location. This takes a short while, often several minutes, so changes are not instant everywhere.

3

Edge servers

Terminate visitor connections, apply firewall rules, match routes, check the cache, and talk to origins.

4

Health system

Edge locations send small test requests to origins, called probes, and share what they learn, so each location knows which origins are healthy.

5

Telemetry

Counts, delays, and request records flow to Azure Monitor, so you can watch what is happening.

!
Gotcha

Because configuration spreads gradually, a freshly saved rule may behave differently in different parts of the world for a few minutes. Plan changes with this in mind, and do not panic-edit while one is still spreading.

7Internal Working: TLS, Split TCP and the Request Pipeline

What the edge server does, step by step, in the few milliseconds before your origin even hears about the request.

TLS termination at the edge

When a visitor opens a secure connection, the edge server presents your certificate and completes the encryption handshake right there. This is called TLS termination. The visitor-to-edge connection is encrypted. Front Door then opens a separate connection to the origin, and you can require that this second connection is encrypted too. Keeping both legs encrypted is called end-to-end TLS, and it is the best practice.

Split TCP

A normal connection between a faraway visitor and a server suffers from slow starts and recovery delays whenever any packet is lost along the long path. Split TCP divides one long connection into two shorter ones: visitor to edge, and edge to origin. Each short connection recovers quickly from small problems, and the edge-to-origin leg is kept open and reused for many visitors. The effect is like a relay race, where each runner covers a short stretch at full speed.

HTTP versions and keep-alive

Modern web connections can send many requests at once over a single link. Front Door supports modern HTTP versions with visitors, and keeps persistent, reusable connections toward origins. Reusing a connection avoids repeating the expensive setup every time.

The request pipeline

Inside the edge server, each request passes through ordered stages. Understanding the order helps you explain surprising behavior.

1

Accept and decrypt

The connection is accepted, TLS is completed, and the request is read.

2

Firewall check

If a WAF policy is attached to the domain, the request is inspected first. Bad requests are blocked before any other work is done.

3

Route matching

The host name and path are compared with your routes, and the most specific match wins.

4

Rule set actions

Redirects, rewrites, and header changes are applied, and they can even change which origin group is used.

5

Cache lookup

If caching is on and a fresh copy exists, the edge answers immediately and the origin is never bothered.

6

Origin selection and forwarding

Otherwise, a healthy origin is chosen, the request is forwarded, and the answer is sent back, possibly saving a copy in the cache.

Everyday analogy

A hotel front desk checks your booking (firewall), reads your reservation to find your room type (route matching), adds any special requests such as an extra pillow (rule sets), offers you a ready-made welcome basket if one is on the shelf (cache), and only calls housekeeping upstairs when something special must be prepared (origin).

Headers that Front Door adds

Because the origin now sees Front Door as the caller, the original visitor’s details can be lost. To help, Front Door adds extra headers (small labeled notes attached to a request). One tells the origin the visitor’s original address, another tells which website name the visitor used, and another carries a unique Front Door identifier. Origins can read these to log real visitor addresses and to verify that a request truly came from your Front Door profile.

i
Interview-ready

If asked why Front Door makes dynamic pages faster, say: it terminates TLS near the visitor, splits the connection in two, keeps warm reusable connections to origins, and carries the long distance over Microsoft’s private backbone instead of the open internet.

8Data Flow: The Life of a Request

Follow one visit from the moment a person presses Enter to the moment the page appears.

sequenceDiagram
    participant U as Visitor browser
    participant D as DNS
    participant E as Nearest edge location
    participant C as Edge cache
    participant O as Healthy origin
    U->>D: Look up www.yourcompany.com
    D-->>U: Alias to Front Door endpoint address
    U->>E: Secure connection and request
    E->>E: Firewall check and route match
    E->>C: Is a fresh copy stored
    C-->>E: Not found
    E->>O: Forward request over backbone
    O-->>E: Response
    E->>C: Save copy if allowed
    E-->>U: Response delivered
    
FIG 8.1 — A cache miss, the longest normal path
1

Name lookup

Your company’s DNS record points the website name to the Front Door endpoint. DNS then returns an anycast address, so the visitor’s traffic is pulled to a nearby edge location.

2

Secure handshake

The edge server presents the certificate for the requested name and completes encryption quickly because it is close.

3

Policy and routing

Firewall rules, route matching, and rule sets run. A redirect rule might end the journey right here with an instruction to go elsewhere.

4

Cache decision

On a hit, the edge responds at once. On a miss, it moves on to an origin.

5

Origin choice

The edge picks the best healthy origin using the routing method of the group, then forwards the request over a warm connection.

6

Response and logging

The answer returns, may be stored for later visitors, and a record of the request is written to your logs.

Cache hit versus cache miss

A cache hit means the edge already holds a valid stored copy. The response is quick and the origin does zero work. A cache miss means the edge must go to the origin. Dynamic API calls are usually misses by nature. The share of requests served from the edge is called the hit ratio, and raising it is one of the cheapest ways to improve speed and cut costs.

When things go wrong

If the chosen origin is slow or returns errors, Front Door can retry another origin in the group for many types of requests. If no origin is healthy, the visitor receives an error page generated by Front Door itself. Seeing an error code in logs tells you which side failed: a gateway-style error generally points at the origin side, while a refusal or forbidden code often points at your firewall rules or route settings.

!
Timeouts

Front Door waits only a limited time for an origin to answer. A slow report that takes longer than that limit will fail at the edge even if the origin would eventually finish. Long jobs should be redesigned as start-then-poll, or handled by a background process.

9Routing, Health Probes and Load Balancing

How Front Door chooses among your servers, and how it knows which ones are alive.

Health probes

A health probe is a tiny, regular test request that Front Door sends to each origin, for example asking for a simple status page. If the origin answers correctly, it is considered healthy. If it keeps failing, it is taken out of rotation until it recovers. You choose the path, the protocol, the type of request, and how often to probe.

Good probe design matters. A probe path that only returns “OK” without touching the database may report healthy while the app is broken. A probe path that runs a heavy database check on every request may overload your own servers, since many edge locations probe at the same time. A balanced status page that checks the critical dependencies lightly is the usual answer.

Load-balancing settings

Within an origin group you decide how many recent probe samples to examine and how many must succeed for an origin to count as healthy. You also set a latency sensitivity, a small time margin. Origins whose response times are within this margin of the fastest one are treated as roughly equal, so traffic can spread among them instead of piling on the single fastest.

Origin priority and weight

Each origin has two knobs.

Knob 1

Priority

A lower number means a more preferred origin. Traffic goes to priority one while it is healthy, and moves to priority two only if priority one is down. Perfect for active and standby designs.

Knob 2

Weight

Among origins with the same priority, weight sets the share of traffic. A weight of 900 and a weight of 100 means roughly ninety to ten. Perfect for gradual rollouts.

Mode

Latency based

Among origins of equal priority, requests favor those with the lowest measured delay from that edge location.

Option

Session affinity

A cookie keeps one visitor on the same origin, for apps that store sessions in server memory. Use only when truly needed.

flowchart TD
    R["Request at edge"] --> PR{"Any healthy origin at priority 1"}
    PR -->|"yes"| P1["Choose among priority 1 origins"]
    PR -->|"no"| P2["Choose among priority 2 origins"]
    P1 --> LAT["Keep origins within latency margin of the fastest"]
    LAT --> W["Pick by weight"]
    P2 --> LAT
    W --> OUT["Forward to chosen origin"]
    
FIG 9.1 — How an origin is chosen for a request
Everyday analogy

Imagine a taxi dispatcher. Preferred drivers (priority one) get the calls first. If none are available, backup drivers get them. When several preferred drivers are free, the dispatcher usually chooses the nearest, but sometimes shares calls so one driver is not overworked. Weights are like telling the dispatcher “give the new trainee only a few calls today”.

Common routing recipes

  • Active-active across regions: two or more regions at the same priority, so visitors are served from the nearest healthy one.
  • Active-passive: a primary region at priority one and a disaster region at priority two that receives traffic only during failures.
  • Gradual rollout: send ten percent of traffic to a new version through a small weight, watch errors, then raise the weight step by step.
  • Path-based split: one route for /api to application servers and another for /static to a storage account.
i
Remember

When only one origin exists in a group, Front Door may stop probing it and treat it as always available, since there is nowhere else to send traffic. Add at least two origins if you want real failover.

10Caching, Compression and the Rules Engine

The fastest request is the one your origin never sees.

How caching works

When caching is enabled on a route, the edge stores copies of responses for a time. How long depends on instructions from the origin, usually in a header called Cache-Control, or on a time you set in a rule. While a copy is fresh, later visitors in that region get it straight from the edge. Each edge location keeps its own cache, so the first visitor in a region may see a miss, and the next ones see hits.

Everyday analogy

A bakery keeps popular loaves on the front shelf. Customers get them at once. When the shelf empties or the bread goes stale, a fresh batch is brought from the back oven. Cache-Control is the label that says how many hours a loaf stays sellable.

What should and should not be cached

Good to cache

  • Images, fonts, style sheets, and scripts
  • Downloadable files and videos
  • Public pages that change rarely
  • Versioned files, where a new version has a new name

Do not cache

  • Pages that differ for each signed-in person
  • Responses containing private data or tokens
  • Shopping carts and checkout steps
  • Write calls such as saving or deleting

Query strings and cache keys

A cache key is the identity used to look up a stored copy. By default it can ignore the part of a web address after a question mark (the query string), or include it. If you ignore it, a page that truly changes by query, such as a search result, could be served wrongly. If you include everything, tiny harmless differences like tracking tags create separate copies and lower the hit ratio. Choose a query-string behavior that matches how your content really varies.

Compression

Front Door can compress text-like files such as pages, style sheets, and scripts before sending, which shrinks the data and speeds up downloads, especially on mobile networks. Already-compressed formats such as most images and videos gain nothing and are skipped.

Purging

If you publish a fix and cannot wait for the old copy to expire, you can purge the cache, telling all edge locations to forget chosen paths. Purges take a short while to spread, and frequent heavy purging defeats the purpose of caching, so prefer versioned file names that naturally avoid stale copies.

The rules engine

A rule set is a list of rules, and each rule has conditions and actions. For example, a condition may check the visitor’s country, the device type, a request header, or the path. Actions can redirect, rewrite the path before it reaches the origin, add or remove headers, override cache time, or even pick a different origin group.

NeedRule idea
Force secure connectionsRedirect insecure web addresses to the secure version
Move an old pageIf path starts with the old section, redirect to the new section
Hide internal pathsRewrite the public path to the real origin path
Tell the app about the deviceAdd a header based on the device type
Keep fast pages fastOverride cache duration for static folders
Add safety headersAppend security headers to every response

11Security: Standing at the Door

Front Door is a strong place to stop bad traffic, because it sees requests before your servers do.

flowchart TD
    A["Internet traffic including attackers"] --> D["Network level flood absorption at the edge"]
    D --> T["TLS with managed or own certificate"]
    T --> W["Web application firewall"]
    W --> L["Rate limits, geo filters, IP rules"]
    L --> R["Routing to origin"]
    R --> P["Private Link or locked down public origin"]
    P --> S["Origin application with its own checks"]
    
FIG 11.1 — Defensive layers between the internet and your app

Absorbing floods

A distributed denial of service attack tries to knock a site offline by sending overwhelming traffic from thousands of machines. Front Door’s global edge spreads and absorbs much network-level flooding, so your origin does not face it directly. This is a basic built-in layer, and it complements, but does not replace, a dedicated Azure DDoS protection plan on your own networks when your design requires one.

The web application firewall

A web application firewall, or WAF, reads the content of web requests and blocks ones that look malicious. It targets attacks on the application itself, such as SQL injection (sneaking database commands into form fields) and cross-site scripting (sneaking harmful scripts into pages). Rules come in two flavors.

You write

Custom rules

Block or allow by IP range, country, header value, or request size, and set rate limits that cap how often one client may call you.

Microsoft maintains

Managed rule sets

A large, regularly updated collection that detects common attack patterns, including a bot protection set. Available with Premium.

The WAF has two modes. Detection mode only logs suspicious requests, which is useful for learning what normal traffic looks like. Prevention mode actually blocks them. A wise rollout starts in detection mode, studies the logs for false positives (good requests wrongly flagged), tunes exclusions, and then switches to prevention.

Certificates and encryption

Managed certificates renew themselves, removing a classic cause of surprise outages: the forgotten expiring certificate. You can also set a minimum TLS version to refuse old, weak protocol versions, and require encrypted connections to origins.

Locking the back door

The most common mistake is to protect the front door and forget the back. If your origin still answers anyone on the internet, attackers can bypass Front Door and the WAF by contacting the origin directly. There are three layers of defense.

  • Network allow-list: permit only Front Door’s published address ranges, using the Azure service tag for Front Door’s back-end addresses.
  • Header check: make the origin require the Front Door identifier header, so requests from other Front Door profiles are refused.
  • Private Link (Premium): give the origin no public address at all. Traffic from Front Door arrives through a private connection that you approve.
Everyday analogy

A building with a strong guarded lobby but an unlocked loading dock is not secure. Locking the origin is locking the loading dock so that the only way in is through the lobby.

!
Classic mistakes

Leaving origins open to the world, forgetting that the allow-list alone does not stop other Front Door customers (so add the identifier header check), running the WAF in detection mode forever, and caching responses that contain private data.

12High Availability and Resilience

Staying up when servers, regions, and even parts of the edge have trouble.

Resilience of the edge itself

Front Door is a global service built from many edge locations. If one location has trouble, internet routing sends visitors to another nearby one. You do not choose or manage this. Microsoft publishes an availability promise (an SLA) for the service, and you should read the current version when you need an exact figure.

Resilience of your origins

That part is your design. A single origin is a single point of failure, no matter how good the edge is. The usual pattern places the same application in two or more regions and puts them in one origin group, with health probes watching each.

flowchart TD
    V["Visitors worldwide"] --> FD["Front Door global edge"]
    FD --> OGR["Origin group with health probes"]
    OGR --> R1["Region one: app tier"]
    OGR --> R2["Region two: app tier"]
    R1 --> DB1["Primary data store"]
    R2 --> DB2["Replica data store"]
    DB1 -->|"replication"| DB2
    FD -.->|"if all origins fail"| ST["Static fallback page in storage"]
    
FIG 12.1 — Multi-region origins with a static fallback

Failure scenarios and responses

What failsWhat happensWhat you should have ready
One origin serverProbes fail, traffic moves to others in the groupAt least two origins and a meaningful probe path
A whole origin regionAll origins there go unhealthy, traffic flows to the other regionCapacity in the other region and replicated data
An edge locationInternet routing sends visitors to a nearby oneNothing, but retry logic in clients helps
A bad configuration changeMisrouting can reach many visitors within minutesChange review, staged rollout, and quick rollback
Expired custom certificateVisitors see security warningsManaged certificates or renewal alerts

Data matters more than traffic

Moving traffic to a second region is the easy half. If the second region has no current copy of the data, or sessions live only in the first region’s memory, failover produces errors rather than recovery. Plan data replication, shared session storage, and capacity at the same time as routing.

A thought about the “single front door”

Using one global service in front of everything means your design depends on it. Some very risk-averse teams prepare a break-glass plan: a documented way to point their domain directly at origins or at an alternative path through DNS, if the front layer ever has a serious incident. This is rarely used, but writing and rehearsing it is cheap compared with improvising in an outage.

i
Keep DNS records short-lived where needed

If your break-glass plan relies on changing DNS, use a modest record lifetime so that a switch takes effect within minutes, not hours.

13Performance and Scalability

Make it faster by moving less data, over shorter distances, with fewer round trips.

Scale without effort at the edge

The edge fleet grows and shrinks on its own with traffic. You do not choose server counts or sizes. What you must scale is your origins, and Front Door helps by absorbing repeated requests through caching, which lowers the load they see during spikes.

The performance toolbox

Fewer trips

Cache aggressively

Set long lifetimes for versioned files. Aim for a high hit ratio on static content.

Smaller bytes

Compress and optimize

Turn on compression for text, serve right-sized images, and avoid shipping unused scripts.

Closer

Place origins wisely

Put origins in regions near your largest audiences, and keep origins in the same region as their databases.

Smarter

Use the right routing

Prefer latency-based choices among equal origins, and avoid session affinity unless required.

Measuring what visitors feel

Two numbers matter. Total latency is the time from the edge receiving a request to the visitor getting the whole answer. Origin latency is how long the origin took. The gap between them shows how much time is spent on the edge side and on the network. If origin latency is the large part, tuning the origin application will help more than any edge setting.

Everyday analogy

If a pizza arrives late, you want to know whether the oven was slow or the delivery rider was slow. Total latency is the whole wait, origin latency is the oven time, and the difference is the ride.

Protecting origins from stampedes

When a popular cached item expires, many edge locations may ask the origin for a fresh copy at once. Good cache lifetimes, staggered expiry, and an origin that can handle brief bursts keep this harmless. Front Door also combines identical simultaneous requests for the same cacheable item at one location so that the origin sees fewer duplicates.

i
Understand the limits

Front Door has quotas, such as the number of routes, domains, and rules per profile, maximum request sizes, and the origin response timeout. They change with time, so review the current limits page for your tier before designing a large setup.

14Monitoring, Logging and Metrics

You cannot fix what you cannot see, and with a global service you need to see it by region.

Metrics

Metrics are numbers collected over time and shown as charts. The ones to watch from the start are below.

MetricWhat it tells youWorry sign
Request countTraffic volume over timeSudden spikes or drops
Response status classesShare of successes, client errors, server errorsRising server-error share
Total latencyEnd-to-end delay felt by visitorsSlow drift upward
Origin latencyHow slow your servers areHigh compared with total latency
Origin health percentageHow many origins pass probesBelow one hundred for long
Byte hit ratioShare of data served from the edgeFalling after a release
WAF requestsBlocked and logged attacksBig surges from one country or address range

Logs

Metrics tell you that something changed. Logs tell you exactly which request did what. Through diagnostic settings you can send logs to a Log Analytics workspace, a storage account, or an event stream.

  • Access logs: one record per request, with the visitor address, the path, the status, the cache result, and timings.
  • Health probe logs: every probe result for every origin, so you can see exactly when and why an origin was marked unhealthy.
  • WAF logs: which rule matched, which request, and whether it was blocked or only logged.

Keep in mind that busy sites generate a huge amount of log data, which has a storage and analysis cost. Decide which logs you truly need, and set retention accordingly.

Alerts and a simple routine

1

Alert on symptoms

Create alerts for high server-error rates, low origin health, rising latency, and certificate expiry warnings.

2

Find the layer

Check whether the problem is at the edge, in routing, in the firewall, or in the origin by comparing total latency and origin latency, and by reading status codes.

3

Look at the exact requests

Filter access logs by a failing path or a request identifier to see real examples.

4

Fix and confirm

Apply the fix, watch the metric recover, and add a test or alert so you catch it sooner next time.

i
Use the reference ID

Front Door can include a unique reference in error responses and logs. When a user reports a problem, ask for that reference. It lets you find the exact request in seconds instead of hours.

15Deployment, Migration and Cost Control

Setting it up repeatably, moving a live site onto it without a scare, and keeping the bill predictable.

Setting up a new site

The portal is a friendly place to learn, but real projects describe their Front Door setup in text files using infrastructure as code tools such as ARM templates, Bicep, or Terraform. The files say what you want: the profile, tier, endpoints, domains, origin groups, routes, rule sets, and WAF policy. A pipeline then applies them the same way every time, so test and production behave alike and every change can be reviewed like any other piece of work.

1

Create the profile and endpoint

Choose the tier, and let Azure issue the endpoint name.

2

Add origins and the origin group

Define health probes and load-balancing settings, and test that the probe path returns a good answer.

3

Create the route and rules

Match domains and paths, set caching, add redirects and header rules.

4

Attach a custom domain

Prove ownership of the domain with a special DNS record, and let Front Door create the managed certificate.

5

Test through the endpoint name

Check the site using the Front Door endpoint before touching your public DNS.

6

Switch DNS

Point the public name at Front Door, then lock down the origins so only Front Door can reach them.

!
DNS detail for bare domains

A name like yourcompany.com with nothing before it (an apex domain) cannot use an ordinary alias record in standard DNS. Use a DNS provider that supports alias-style records for the root, such as Azure DNS, or serve the site on a name like www.

Moving a live site safely

The safest path is gradual. First, build the whole Front Door setup and test it using its own endpoint name. Second, lower your DNS record lifetime ahead of time, so a rollback is fast. Third, switch a small slice of traffic if your DNS service supports weighted answers, or switch off-peak. Fourth, watch the metrics closely. Fifth, once stable, restrict the origins and raise the record lifetime again. Always keep a note of the previous DNS values for rollback.

Moving from classic versions

If you use an older classic profile, Microsoft provides migration tools that convert it to a Standard or Premium profile with limited downtime. Start planning early, since official retirement dates are fixed, and test the converted profile before cutting over.

Safe change practice

Because configuration reaches the whole world, treat changes seriously. Review them in a pull request, apply to a test profile first, roll out to production during a quiet hour, and keep the previous version of the files ready for a fast revert.

Understanding and controlling cost

Pricing has several parts, and knowing them helps you predict your bill. Exact rates vary by region and over time, so use Microsoft’s calculator for numbers.

Fixed

Base fee

A monthly charge per profile, higher for Premium than for Standard.

Per request

Request charges

A small amount for every million requests handled at the edge, plus extra for firewall-inspected requests where applicable.

Per byte

Data transfer

Charges for data leaving the edge to visitors and for data sent from the edge to origins, which vary by zone.

Extras

Logs and WAF extras

Storing and analyzing logs costs money, and custom or managed firewall features may add to the bill depending on the tier.

Ways to lower cost

  • Raise the cache hit ratio, so fewer bytes travel from origins
  • Compress text content
  • Choose Standard unless you need Premium features
  • Combine several sites in one profile when they share the same needs
  • Limit log volume and retention to what you use

Common cost surprises

  • Large downloads served without caching
  • Bots hammering expensive paths with no rate limits
  • Verbose logs kept forever
  • Forgotten test profiles each paying a monthly base fee

16Design Patterns and Anti-patterns

A pattern is a recipe that worked many times. An anti-pattern is a trap that looks tempting and hurts later.

Helpful patterns

Pattern: Global entry with regional back ends

Front Door at the edge, one application stack per region behind it, and replicated data. This gives low delay for everyone and resilience when a region fails.

Pattern: Static and dynamic split

Serve files such as images and scripts from a storage account with heavy caching, and send API calls to application servers with caching off. Each path is tuned for what it carries.

Pattern: Canary release using weights

Send a small percentage of traffic to the new version through a low weight, compare error rates and speed, and raise the weight gradually. If trouble appears, set the weight to zero.

Pattern: Private origins

With Premium, origins have no public address and accept only Private Link traffic from Front Door, shrinking the attack surface to the edge alone.

Pattern: Multi-site profile

One profile serves several brands or applications, each with its own domain, route, and rules, giving shared management and a single place for logging and firewall policy.

Pattern: Static fallback

Keep a simple “we will be right back” page in a storage account as the last origin, so visitors see a friendly message instead of a raw error if everything else is down.

flowchart LR
    V["Visitors"] --> FD["Front Door"]
    FD -->|"static path"| ST["Storage account with caching"]
    FD -->|"api path"| API["Regional API services"]
    FD -->|"web path"| WEB["Regional web apps"]
    API --> DB["Data layer"]
    WEB --> DB
    FD -.->|"firewall"| WAF["WAF policy"]
    
FIG 16.1 — Path-based split between static files, APIs and web apps

Anti-patterns to avoid

ANTI-01Avoid
The trap

Putting Front Door in front but leaving the origin open to the whole internet.

Why it hurts

Attackers and scrapers go straight to the origin and skip the firewall, caching, and rate limits. You pay for protection you do not actually have.

Better approach

Restrict the origin to Front Door only, with an address allow-list plus the identifier header check, or use Private Link on Premium.

ANTI-02Avoid
The trap

Caching personalized or private responses, or ignoring the Vary and Cache-Control headers.

Why it hurts

One user can be shown another user’s data. This is a serious privacy incident, not just a bug.

Better approach

Mark private responses as not cacheable at the origin, enable caching only on routes meant for public content, and test with two different accounts.

ANTI-03Avoid
The trap

A health probe that always returns success, or one that runs an expensive database query on every probe.

Why it hurts

The first hides real failures so traffic keeps flowing to broken servers. The second creates its own load and can cause outages.

Better approach

Build a light status endpoint that quickly checks only the critical dependencies and returns a clear success or failure.

ANTI-04Avoid
The trap

Turning on the WAF in blocking mode on day one without any tuning, or leaving it in log-only mode forever.

Why it hurts

The first blocks real customers by mistake. The second gives a false feeling of safety.

Better approach

Start in detection mode, study the logs, add exclusions for legitimate patterns, then move to prevention with monitoring.

ANTI-05Avoid
The trap

Using session affinity to cover for an application that keeps user state in server memory.

Why it hurts

Failover logs users out, traffic spreads unevenly, and scaling becomes awkward.

Better approach

Store sessions in a shared cache or database so that any origin can serve any visitor.

17Best Practices and Common Mistakes

A practical checklist to carry into any project.

Do this

  • Use at least two origins in different locations for anything important
  • Require encrypted connections to origins as well as from visitors
  • Use managed certificates so renewal is automatic
  • Lock origins so only Front Door can reach them
  • Introduce the WAF in detection mode, tune, then enforce
  • Design a simple, honest health endpoint
  • Cache public static content with long lifetimes and versioned names
  • Send logs to a central workspace and alert on symptoms
  • Manage configuration as code with reviews
  • Rehearse failover and rollback

Avoid this

  • Single-origin designs that claim to be highly available
  • Editing production routes by hand in a hurry
  • Caching anything that depends on who is signed in
  • Forgetting that firewall exceptions can open real gaps
  • Assuming a change is live everywhere the second you save it
  • Ignoring the origin response time limit with slow endpoints
  • Paying for Premium features you never turn on
  • Leaving old test profiles running

Mistakes beginners make, and how to dodge them

  • Blaming Front Door for origin slowness. Compare total latency and origin latency before touching edge settings.
  • Confusing redirect with rewrite. A redirect tells the visitor’s browser to go to a new address. A rewrite quietly changes the path sent to the origin while the visitor’s address stays the same.
  • Testing only from one city. Behavior at the edge differs by location, since caches and health views are per location. Test from several places.
  • Forgetting the host header. Some origins, especially shared hosting platforms, choose a site based on the host name. Make sure the origin host header is set to what the origin expects.
  • Relying only on the edge for security. Keep input checks, authentication, and authorization in the application too.
“Put the smart work at the edge, the real work at the origin, and the trust nowhere you have not verified.”

18Real-World Scenarios

Four typical situations, described as realistic example setups, showing how the pieces combine.

Scenario 1: A worldwide online store

A retailer with customers on four continents places its web application in two regions, one in Europe and one in North America, behind a single Front Door profile. Product images and scripts are cached hard at the edge, while cart and checkout calls go straight to the nearest healthy region. The WAF in prevention mode blocks common attacks, and rate limits protect the login page from password-guessing bots. During a regional incident, traffic flows to the other region within minutes with no change to the public address.

Scenario 2: A news publisher with traffic spikes

A news site experiences huge, sudden surges when a story breaks. Article pages are cached for a short period, say a minute or two, which turns thousands of visits per second into a handful of origin requests. Images are cached for days. Editors who publish a correction use a targeted purge for that single article, so readers see the update quickly.

Scenario 3: A software-as-a-service product with many customer domains

A product lets each customer use their own website name. The team adds each customer domain to one profile, relies on managed certificates that renew by themselves, and routes all of them to the same origin group, with a header rule that tells the application which customer domain was used. A scripted onboarding step creates the domain and waits for validation, instead of someone clicking in the portal.

Scenario 4: A regulated internal-facing portal

A company must keep its application servers off the public internet. It chooses Premium, gives the origins no public addresses, and approves a private connection from Front Door. Only the edge is exposed, with managed firewall rules and bot protection enabled. Auditors can see in logs exactly which requests were allowed or blocked.

i
A note on these examples

These are composite examples created to teach design choices, not claims about any named company’s private architecture. Microsoft’s official customer stories are a good source of real, verified case studies.

How to talk about it in an interview

A strong short answer might sound like this: “Azure Front Door is Microsoft’s global Layer 7 entry point. Visitors connect to the nearest edge location through anycast, TLS ends there, and requests ride the Microsoft backbone to the best healthy origin. I use origin groups with priority and weight for failover and canary releases, caching for static content, a WAF for attack protection, and Private Link on Premium to remove public access to origins. I watch total versus origin latency, health probe results, and WAF logs.” Then be ready to explain the reasoning behind each choice using the ideas in this guide.

19Frequently Asked Questions

Q1Is Azure Front Door a CDN?
It includes CDN features such as edge caching, but it is broader. It also handles smart global routing, health checks, dynamic acceleration, and a web application firewall.
Q2What is the difference between Front Door and Application Gateway?
Front Door is global and sits at the edge near visitors. Application Gateway is regional and sits inside your network. Many designs use both, one after the other.
Q3Can Front Door send traffic to servers outside Azure?
Yes. An origin can be any reachable public web address, including servers in another cloud or your own data center. Private Link applies only to supported Azure services.
Q4Does Front Door work for APIs, or only websites?
It works for APIs too, since they use the same web protocols. Most API responses should not be cached, but they still benefit from edge connection setup, routing, firewall protection, and failover.
Q5Why did my change not take effect right away?
Configuration is distributed to many edge locations, which takes a few minutes. Wait for the deployment status to finish before testing, and test from more than one place.
Q6How does Front Door know an origin is down?
Edge locations send regular probe requests and count recent successes and failures. An origin that fails too many probes is taken out of rotation until it passes again.
Q7Can I stop people from bypassing Front Door?
Yes. Restrict the origin to Front Door’s address ranges, require the Front Door identifier header, and on Premium use Private Link so the origin has no public address.
Q8What happens if all origins are unhealthy?
Front Door has nowhere good to send traffic, so visitors receive an error. A static fallback origin or a custom error experience can soften this.
Q9Should I use Standard or Premium?
Pick Standard for public sites that need acceleration, routing, and custom firewall rules. Pick Premium when you want managed attack rules, bot protection, or private origins.
Q10Can Front Door handle WebSocket or large file uploads?
Support for these features and their size and time limits depends on the current service version and settings. Check the current limits page before relying on very large uploads or long-lived connections.
Q11How do I get the real visitor address in my application?
Read the forwarded-for style header that Front Door adds. Use it for logs and rules, but remember that anyone who can reach your origin directly could fake it, which is another reason to lock the origin.
Q12What is the single best way to improve cost and speed together?
Raise the cache hit ratio for public content. More requests served at the edge means faster pages for visitors and lower load and transfer from your origins.

20Summary and Key Takeaways

You have now followed a visitor from the moment of the first name lookup through an anycast edge location, a firewall check, a route match, a cache decision, and a trip over the Microsoft backbone to a healthy origin. The thread through everything is simple: Azure Front Door moves the hard work of speed, protection, and failover to the edge of the network, while you keep responsibility for good origins, honest health checks, careful caching, and locked doors.

Key Takeaways

  • Front Door is a global Layer 7 entry point. It combines acceleration, routing, caching, and a web application firewall in one service.
  • Close to the visitor is the secret. Anycast, TLS termination at the edge, split TCP, and the private backbone make even dynamic content faster.
  • Know the building blocks. Profile, endpoint, custom domain, origin group, origin, route, rule set, and WAF policy each have a clear job.
  • Priority and weight shape traffic. Use them for active-passive designs, regional preference, and gradual canary releases.
  • Cache only what is safe. Public static content gains the most, and personalized content must never be cached.
  • Lock the back door. Restrict origins to Front Door through allow-lists, header checks, or Private Link, and tune the WAF before enforcing it.
  • Observe and rehearse. Watch total versus origin latency, probe health, and WAF logs, and practice failover and rollback before you need them.