azureazure-traffic-manager

Azure Traffic Manager Custom Header for routing to endpoint


I have a multi-tenant SaaS app that has been running behind Azure Traffic Manager (Configured using the Priority method) for some time now. (Tenants are identified by subdomain, ie tenant1.mydomain.com, tenant1.mydomain.com, etc)

Now I have added an endpoint to my Azure Traffic Manager, and specified a Custom Header Setting as follows: host:[tenantX].mydomain.com.

My expectation is that all requests for tenantX.mydomain.com should be now routed to the new endpoint I have added, but logging shows that this is not the case...all requests are still going to the priority 1 endpoint.

Am I missing something, or is this not supposed to be what Azure Traffic Manager's Custom Header settings are supposed to used for? Or should I be changing the routing method? If so, to what?


Solution

  • The Custom Header settings are used to specify a host header ensuring that it hits the correct site when Traffic Manager performs health monitoring. It does not set which requests get routed to which endpoints. You only could define the routing methods via the six traffic-routing methods to determine how to route network traffic to the various service endpoints.

    For example, in this blog, you will see that it needs to set the hostname under custom header settings to let Ambassador know which container application in the Kubernetes cluster it should forward the endpoint monitoring request.

    Custom header settings This configuration setting helps you add specific HTTP headers to the health checks that Traffic Manager sends to endpoints under a profile. The custom headers can be specified at a profile level to be applicable for all endpoints in that profile and / or at an endpoint level applicable only to that endpoint. You can use custom headers for having health checks to endpoints in a multi-tenant environment be routed correctly to their destination by specifying a host header. You can also use this setting by adding unique headers that can be used to identify Traffic Manager originated HTTP(S) requests and processes them differently. You can specify up to eight header:value pairs seprated by a comma. For example, "header1:value1,header2:value2".