Azure Traffic Manager: Overview and Usage
On this page
Introduction
Azure Traffic Manager is a DNS-based traffic load balancer that enables you to distribute traffic optimally to your services, hosted in the Azure cloud or even on-premises. It allows for high availability and responsiveness by directing user traffic to the most appropriate endpoint based on a chosen traffic-routing method.
Note: Traffic Manager operates at the DNS level. It does not inspect network traffic. For application-level load balancing and content inspection, consider Azure Load Balancer or Application Gateway.
How it Works
When a user requests a resource from your application, the DNS query is first sent to Traffic Manager. Traffic Manager then evaluates the DNS request based on the configured routing method and endpoint health, and returns the IP address of the selected endpoint. The user's browser or client then connects directly to that endpoint.
Traffic-Routing Methods
Traffic Manager supports several intelligent traffic-routing methods to meet different application requirements:
- Priority: Directs all traffic to a primary endpoint. If the primary endpoint is unavailable, traffic is automatically failed over to a secondary endpoint.
- Weighted: Distributes traffic across a set of endpoints based on specified weights. This is useful for phased rollouts or for sharing load across multiple endpoints.
- Performance: Directs users to the endpoint with the lowest network latency to them. This improves application responsiveness.
- Geographic: Directs users to endpoints based on their geographic location. This is ideal for compliance requirements or for providing a localized experience.
- Multivalue: Returns multiple healthy endpoints to the DNS query, allowing the client to choose which endpoint to connect to.
- Subnet: Maps IP address ranges of users to specific endpoints. This allows you to direct users from certain subnets to specific endpoints.
Key Features
- High Availability: Ensures your application remains available by automatically failing over to healthy endpoints.
- Performance Optimization: Improves user experience by directing traffic to the closest or best-performing endpoint.
- Global Reach: Distribute your services across multiple Azure regions or even hybrid environments.
- Endpoint Monitoring: Continuously monitors the health of your endpoints and removes unhealthy ones from DNS resolution.
- Flexible Routing: Supports various routing methods to suit diverse application needs.
- Integration: Works seamlessly with other Azure services.
Common Use Cases
- Disaster Recovery: Deploying identical applications in multiple regions and using priority routing for automatic failover.
- Improving Application Responsiveness: Using performance routing to direct users to the nearest datacenter.
- Phased Rollouts: Gradually shifting traffic to a new version of an application using weighted routing.
- Compliance: Ensuring data resides within specific geographic boundaries using geographic routing.
Getting Started
To start using Azure Traffic Manager:
- Create a Traffic Manager profile: In the Azure portal, search for "Traffic Manager profiles" and create a new one.
- Configure routing method: Choose the traffic-routing method that best suits your application's needs.
- Add endpoints: Specify the endpoints (e.g., Azure App Services, Cloud Services, Public IP addresses) that Traffic Manager will direct traffic to.
- Configure monitoring: Set up health checks for your endpoints to ensure Traffic Manager can detect failures.
- Update DNS: Use the DNS name provided by your Traffic Manager profile in your application's DNS records.
Tip: Always test your Traffic Manager configuration, especially failover scenarios, to ensure it behaves as expected under various failure conditions.
For detailed configuration steps and advanced scenarios, please refer to the official Azure documentation.