Skip to main content
This lesson explains how to configure Azure Traffic Manager for global DNS-based traffic distribution. It covers Traffic Manager profiles, endpoint types (including nested profiles), health probes, portal configuration, common routing methods, and practical testing tips (including Host header behavior with App Services).

Key Concepts

Traffic Manager uses a parent profile that can contain multiple endpoints or nested Traffic Manager profiles (child profiles). Each profile — parent or nested — defines its own routing method. This allows flexible scenarios such as region-based failover or combining multiple routing strategies (for example, a parent profile using Performance routing and a child profile using Priority routing).
  • A Traffic Manager profile has a globally unique DNS name (the profile’s FQDN).
  • Traffic Manager is a global resource; the region selection only stores metadata.
A diagram showing Traffic Manager nested endpoints: a parent Traffic Manager profile routing to child profiles (West US, West Europe, East Asia). The West Europe child profile is shown with two nested endpoints (Production — failed, and Trial) and a note that MinChildEndpoints = 2 so no traffic is sent to the child profile.
Nested profiles can require a minimum number of healthy child endpoints (minChildEndpoints). If the nested profile’s healthy-child count is below this minimum, the parent will not direct traffic to that child profile.

Endpoint types

Use the table to quickly compare Traffic Manager endpoint types and common use cases:
Endpoint TypeUse CaseExample
Azure endpointServices running in Azure (App Services, Cloud Services, Public IPs) — typical Azure-only balancingApp Service or VM in your subscription
External endpointServices outside Azure (on-premises or other clouds) referenced by IP or FQDN — hybrid/migrationOn-premises web server or third-party cloud VM
Nested endpointReferences to other Traffic Manager profiles — aggregation and complex routingParent profile delegates to region-specific child profiles

Routing methods

Choose a routing method based on your objectives (latency, failover, traffic weighting, geo-control). Common choices:
Routing MethodBehaviorWhen to use
Performance (latency)Routes to the endpoint with lowest latency for the clientGlobal performance optimization
PrioritySends all traffic to highest-priority healthy endpoint; failover to nextFailover / primary-secondary setups
WeightedDistributes traffic according to weights you setGradual migrations, canary releases
GeographicRoutes users based on source geographyLegal or regulatory geofencing
Multi-valueReturns multiple healthy IPsClients that can handle multiple IPs for client-side load balancing
SubnetRoutes by client subnet mappingMap specific subnets to specific backends (e.g., corporate vs public)
For full details see: Azure Traffic Manager routing methods.

Creating and configuring a Traffic Manager profile (portal walkthrough)

To create a profile you must:
  1. Provide a globally unique profile name (this becomes the Traffic Manager FQDN).
  2. Select a routing method.
  3. Choose subscription and resource group (Traffic Manager is global — location field stores metadata only).
  4. Create the profile and then configure monitoring and endpoints.
A slide titled "Configuring Traffic Manager Profiles" showing the Azure portal "Create Traffic Manager profile" form with fields for Name, Routing method (dropdown showing options like Performance, Weighted, Priority), Subscription and Resource group, and a Create button. The image includes KodeKloud branding and a Microsoft learn link at the bottom.
After creating the profile, configure the probe (health monitoring) and add endpoints via the Traffic Manager profile blades in the portal.
A screenshot of an Azure "Traffic Manager Endpoints" configuration page showing the Configuration tab and various endpoint monitor settings (DNS TTL, protocol, port, expected status codes, probe timeout). A callout highlights the "Tolerate the number of failures" setting.

Health probe options

  • Protocol: HTTP, HTTPS, or TCP.
  • Port: TCP port to probe.
  • Path: (HTTP/HTTPS) where the probe requests will be directed (e.g., /health).
  • Expected HTTP status codes.
  • Probe interval and timeout.
  • Tolerated failures (how many failures before endpoint marked unhealthy).
  • DNS TTL for the returned CNAME.
  • Optionally: custom request headers for HTTP/HTTPS probes (in some configurations).
These probe settings determine how quickly and accurately Traffic Manager assesses endpoint health.

Portal example: App Services attached to Traffic Manager

In the demo, three App Services were deployed in different regions (East US, Southeast Asia, West Europe). Each app has a customized landing page so you can identify which region served the response.
A screenshot of the Microsoft Azure portal showing the App Services page. It lists three running Web Apps (East US, Southeast Asia, West Europe) with their status, pricing tier (Free), and app service plans.
Screenshot of the Microsoft Azure portal showing the App Services overview for a web app named "app-az700-tm-eastus," with essentials like resource group, status (Running), location (East US) and default domain. The left pane lists other app instances and navigation/settings options.
To create the profile in the portal, select the subscription and resource group where your App Services run, enter the profile name, and choose a routing method (Performance was chosen in this walkthrough).
Screenshot of a cloud management form (Azure) showing "Project details" and "Instance details" fields — the subscription is set to "Kodekloud Labs" and the Resource group dropdown is expanded with many selectable groups. The form also shows fields for Name, Routing method (Performance) and buttons like "Review + create" and "Next: Tags".

Adding endpoints

When adding endpoints:
  • Choose endpoint type (Azure, External, or Nested).
  • For Azure endpoints, select the target resource (e.g., App Service).
  • Enable monitoring (recommended).
  • Optionally enable “Always serve traffic” to override probe results (use with caution).
In the demo, the East US App Service was added as an Azure endpoint named “EUS” with monitoring enabled. The other two App Services (SEA and WEU) were added similarly. Monitoring eventually reported all three endpoints as healthy.
A screenshot of the Microsoft Azure portal showing a Traffic Manager profile's Endpoints page with one endpoint named "eus" (Status: Enabled, Monitor Status: CheckingEndpoint, Type: Azure endpoint, Location: East US) and a notification that Traffic Manager profile changes were saved.
Do not enable “Always serve traffic” unless you understand the implications: it forces Traffic Manager to send traffic to an endpoint even if probes mark it unhealthy. Use it for temporary maintenance overrides only.

Host header behavior with App Service (common pitfall)

When you visit the Traffic Manager FQDN directly in a browser, the browser sends the Traffic Manager domain as the Host header. App Service validates Host headers and only serves requests for hostnames configured on the app. If the app does not have the Traffic Manager domain configured as a custom domain, you’ll get a 404.
A browser screenshot showing a bright blue "404 Web Site not found" Azure error page on the left. On the right is the Chrome DevTools Network panel reporting a 404 for az700-atm-kodekloud.
Example of request headers received by the App Service (note Host header is the Traffic Manager FQDN):
GET / HTTP/1.1
Host: az700-atm-kodekloud.trafficmanager.net
User-Agent: curl/7.79.1
Accept: */*
Because the Host header isn’t configured on the App Service, it returns 404. Recommended production approach:
  • Use a custom domain (e.g., www.example.com) for the Traffic Manager profile.
  • Map the custom domain to the Traffic Manager profile (DNS CNAME).
  • Add and verify the same custom domain on each App Service or backend endpoint so the Host header is accepted.
If you cannot configure a custom domain for testing, simulate the proper Host header with curl or Postman. This confirms DNS and routing work even if the browser shows 404 due to Host header mismatch.

Testing and diagnostics

Use nslookup to see the CNAME targets Traffic Manager returns (these vary by client location when using Performance routing): Example resolving to a Southeast Asia backend:
$ nslookup az700-atm-kodekloud.trafficmanager.net
Server:  192.168.1.1
Address: 192.168.1.1#53

Non-authoritative answer:
az700-atm-kodekloud.trafficmanager.net canonical name = app-az700-tm-southeastasia.azurewebsites.net.
app-az700-tm-southeastasia.azurewebsites.net canonical name = waws-prod-sg1-031.sip.azurewebsites.windows.net.
waws-prod-sg1-031.sip.azurewebsites.windows.net canonical name = waws-prod-sg1-031.southeastasia.cloudapp.azure.com.
Name:   waws-prod-sg1-031.southeastasia.cloudapp.azure.com
Address: 20.188.98.74
From another location you might get an East US backend:
$ nslookup az700-atm-kodekloud.trafficmanager.net
Server: 162.252.172.57
Address: 162.252.172.57#53

Non-authoritative answer:
az700-atm-kodekloud.trafficmanager.net canonical name = app-az700-tm-eastus.azurewebsites.net.
app-az700-tm-eastus.azurewebsites.net canonical name = waws-prod-blu-047.sip.azurewebsites.windows.net.
waws-prod-blu-047.sip.azurewebsites.windows.net canonical name = waws-prod-blu-047.eastus.cloudapp.azure.com.
Name:   waws-prod-blu-047.eastus.cloudapp.azure.com
Address: 40.117.154.240
To test the HTTP response without adding a custom domain, set the Host header to the app service hostname:
curl "http://az700-atm-kodekloud.trafficmanager.net" \
  -H "Host: app-az700-tm-southeastasia.azurewebsites.net"
If the Host header matches an App Service hostname configured on the app, you’ll receive the app’s HTML response. Example snippet returned from the Southeast Asia app:
<html>
<head><title>Happy Learning</title></head>
<body>
  <h1>Happy Learning from Southeast Asia</h1>
  <div class="region">Region: Southeast Asia</div>
  <div class="info">
    <p>App Service: app-az700-tm-southeastasia</p>
    <p>Location: southeastasia</p>
    <p>This endpoint is ready for Traffic Manager configuration</p>
  </div>
</body>
</html>

Summary

  • Azure Traffic Manager provides global DNS-based traffic routing with multiple routing methods and endpoint types (Azure, External, Nested).
  • Nested profiles and minChildEndpoints enable advanced topologies and failover controls.
  • Configure health probes carefully (protocol, path, expected codes, intervals, tolerated failures).
  • In production, use a verified custom domain mapped to the Traffic Manager profile and added to each backend so Host headers are accepted.
  • For testing without a custom domain, set the Host header manually (curl/Postman) to the backend app’s azurewebsites.net hostname.
Now that Traffic Manager configuration and testing are covered, proceed to the next component.