Examine traffic manager
In the previous module, we saw how Deployment slots in Azure Web Apps enable you to swap between two different versions of your application quickly.
Suppose you want more control over the traffic that flows to your other versions. Deployment slots alone aren't enough.
To control traffic in Azure, you can use a component called Azure Traffic Manager.
Azure Traffic Manager
Azure Traffic Manager is a DNS-based traffic load balancer that enables you to distribute traffic optimally to services across global Azure regions while providing high availability and responsiveness.
Traffic Manager uses DNS to direct client requests to the most appropriate service endpoint based on a traffic-routing method and the health of the endpoints.
An endpoint is an Internet-facing service hosted inside or outside of Azure.
Traffic Manager provides a range of traffic-routing methods and endpoint monitoring options to suit different application needs and automatic failover models.
Traffic Manager is resilient to failure, including the breakdown of an entire Azure region.
While the available options can change over time, the Traffic Manager currently provides six options to distribute traffic:
- Priority: Select Priority when you want to use a primary service endpoint for all traffic and provide backups if the primary or the backup endpoints are unavailable.
- Weighted: Select Weighted when you want to distribute traffic across a set of endpoints, either evenly or according to weights, which you define.
- Performance: Select Performance when you have endpoints in different geographic locations, and you want end users to use the "closest" endpoint for the lowest network latency.
- Geographic: Select Geographic so that users are directed to specific endpoints (Azure, External, or Nested) based on which geographic location their DNS query originates from. It empowers Traffic Manager customers to enable scenarios where knowing a user's geographic region and routing them based on that is necessary. Examples include following data sovereignty mandates, localization of content & user experience, and measuring traffic from different regions.
- Multivalue: Select MultiValue for Traffic Manager profiles that can only have IPv4/IPv6 addresses as endpoints. When a query is received for this profile, all healthy endpoints are returned.
- Subnet: Select the Subnet traffic-routing method to map sets of end-user IP address ranges to a specific endpoint within a Traffic Manager profile. The endpoint returned will be mapped for that request's source IP address when a request is received.
When we look at the options the Traffic Manager offers, the most used option for Continuous Delivery is routing traffic based on weights.
Note
Traffic is only routed to endpoints that are currently available.
For more information, see also:
Controlling your canary release
Using a combination of feature toggles, deployment slots, and Traffic Manager, you can achieve complete control over the traffic flow and enable your canary release.
You deploy the new feature to the new deployment slot or a new instance of an application, and you enable the feature after verifying the deployment was successful.
Next, you set the traffic to be distributed to a small percentage of the users.
You carefully watch the application's behavior, for example, by using application insights to monitor the performance and stability of the application.