0

I am trying to find a powershell command which helps find out a way that there is no open connections or any traffic is flowing to endpoint1 or confirm traffic is moving smoothly to endpoint2 after disabling endpoint1:

$e[0].EndpointStatus = "Disabled"
Set-AzureRmTrafficManagerEndpoint -TrafficManagerEndpoint $e

Is there a command to do this? I am not able to find anything in google or should I use some wait command to wait for like a minute to flush out all open connections?

*Basically looking for a way to make sure all in-flight connections are drained from one endpoint before disabling it.

NoviceMe
  • 3,126
  • 11
  • 57
  • 117

1 Answers1

2

Traffic does not flow through your Traffic Manager instance. Therefore, the functionality you are asking for from Traffic Manager does not exist. Traffic Manager simply resolves DNS queries to an IP address of one of your endpoints using the routing method (priority, weighted, performance, etc) you configured it for.

After disabling an endpoint, you could still see traffic going to the disabled endpoint for a period of time measured by your Traffic Manager profile DNS TTL setting. For example, if you disable an endpoint at 3:01:00 and your DNS TTL setting is 90 seconds, then you could see traffic until 3:02:30 because that's how long it could take for any client's DNS cache to expire. One way to monitor this is through the Queries by Endpoint Returned metric described here. This should work in most cases. However, it's not 100%. Just because you disabled an endpoint in Traffic Manager won't stop a client that know's the IP address of your endpoint from calling it. You can decide whether or not this scenario is likely for your application and clients. So, to be absolutely certain there are no active clients using the endpoint, you will need some monitoring in place at the endpoint.

Finally, if you gracefully stop your web app, virtual machine, or other service hosting the endpoint you want disabled, then any active requests to your application will complete before the service shuts down, assuming your application completes requests in a reasonable time (a few seconds).

Documentation on how to test and verify your Traffic Manager settings is available here.

Rick Rainey
  • 11,096
  • 4
  • 30
  • 48
  • So you think if I set TTL to 1 second and wait 1 second to disable endpoint it will work? – NoviceMe Sep 17 '18 at 21:07
  • That means that essentially every request would require a DNS query, adding to the over all response time from your application. It also will increase your Traffic Manger costs. – Rick Rainey Sep 17 '18 at 21:13
  • So is there anyway possible to make sure that all connections are gone through before disabling? Is there a way to route traffic to second endpoint before disabling first? – NoviceMe Sep 17 '18 at 21:19
  • Pretty sure I answered this already. Take a look at the priority routing method if you're not already using it. – Rick Rainey Sep 17 '18 at 21:33