MSDN Documentation

Creating a Traffic Manager Profile

This article guides you through the process of creating and configuring an Azure Traffic Manager profile to distribute network traffic effectively across your cloud services.

Prerequisites

Steps to Create a Traffic Manager Profile

  1. Sign in to the Azure portal

    Navigate to https://portal.azure.com/ and sign in with your Azure account.

  2. Navigate to Traffic Manager profiles

    In the Azure portal search bar, type "Traffic Manager profiles" and select it from the results.

  3. Create a new Traffic Manager profile

    Click the + Create button. This will open the "Create Traffic Manager profile" pane.

    Note: Ensure you select "Traffic Manager profile" and not "Traffic Manager endpoint."
  4. Configure basic settings

    • Name: Enter a unique name for your Traffic Manager profile. This name will be part of the DNS name used to access your services (e.g., my-app-tm.trafficmanager.net).
    • Resource Group: Select an existing resource group or create a new one.
    • Routing Method: Choose a routing method. Common options include:
      • Priority: Directs all traffic to the primary endpoint unless it's unavailable.
      • Weighted: Distributes traffic based on assigned weights to each endpoint.
      • Performance: Directs traffic to the closest endpoint in terms of latency.
      • Geographic: Directs traffic based on the geographic location of the user.
    • DNS Time-to-Live (TTL): Set the TTL for the DNS record. A lower TTL means changes propagate faster but can increase DNS query load.
  5. Add endpoints

    Click the Next: Configuration > button. On the configuration screen, click Add endpoint.

    • Type: Select the type of endpoint (e.g., Azure Endpoints, External Endpoints, Nested Endpoints).
    • Name: Provide a name for the endpoint.
    • Target resource type: Select the resource type of your endpoint.
    • Target resource: Choose the specific Azure resource you want to associate with this endpoint.
    • Priority/Weight/Location: Configure these settings based on your chosen routing method.
    • Repeat this step for all your intended endpoints.
    Tip: For "Performance" routing, ensure your endpoints are in different Azure regions.
  6. Review and create

    Click Next: Tags > if you wish to add tags, and then click Review + create.

    Review the details of your Traffic Manager profile. Once satisfied, click Create.

Post-Creation Configuration

After the profile is created, you can:

By following these steps, you can successfully create an Azure Traffic Manager profile to enhance the availability and performance of your applications.

Example: Using Performance Routing

Let's say you have two web apps, one in East US and one in West Europe. Using "Performance" routing, Traffic Manager will automatically direct users to the datacenter that offers the lowest network latency for them.


// Example conceptual endpoint configuration for performance routing
{
  "name": "my-performance-tm",
  "properties": {
    "profileStatus": "Enabled",
    "trafficRoutingMethod": "Performance",
    "dnsConfig": {
      "ttl": 300
    },
    "monitorConfig": {
      "protocol": "HTTP",
      "port": 80,
      "path": "/"
    },
    "endpoints": [
      {
        "name": "webapp-eastus",
        "type": "Microsoft.Network/trafficManagerProfiles/azureEndpoints",
        "properties": {
          "type": "azureEndpoints",
          "targetResourceId": "/subscriptions/.../resourceGroups/.../providers/Microsoft.Web/sites/webapp-eastus",
          "priority": 1,
          "weight": 1,
          "geoMappings": [ "USEAST" ],
          "endpointStatus": "Enabled"
        }
      },
      {
        "name": "webapp-westeurope",
        "type": "Microsoft.Network/trafficManagerProfiles/azureEndpoints",
        "properties": {
          "type": "azureEndpoints",
          "targetResourceId": "/subscriptions/.../resourceGroups/.../providers/Microsoft.Web/sites/webapp-westeurope",
          "priority": 2,
          "weight": 1,
          "geoMappings": [ "WEUROPE" ],
          "endpointStatus": "Enabled"
        }
      }
    ]
  }
}