1
votes

I set up two web apps in Azure. I'm just using this to test out Traffic Manager for now before I do anything in production, so I created two "fake" apps to try it out.

I added a Traffic Manager to the portal at the following URL:

http://mbfakesite.trafficmanager.net

I listed endpoint 1 as the first web app, and endpoint 2 as the second, and I am using the Priority method.

When I stop the first web app in Azure, and go to the trafficmanager URL, I get a 403 error page. What I want to happen is it to default to the second endpoint.

The end goal is to have an MVC app running on a different server than the production website. And when, the production servers are down (backups and all) it should default to this "failsafe" app running on a separate server, like a worst-case scenario type of thing.

If it makes a different, both web apps for testing are hosted at azurewebsites.net and in Traffic Manager, one is listed as an Azure Endpoint (the first one) and the other is listed as an External Endpoint.

I also tried adding to the web.config, as someone suggested on another post I found, but it changed nothing.

Anyone have any ideas, or alternatives to Traffic Manager we could use for this?

Thank you!

3

3 Answers

2
votes

While the timeline given in the other answer is mostly correct, it overlooks some fundamental aspects of how Traffic Manager operates.

Since Traffic Manager only changes DNS rules, it only works if your browser actually checks that rule. Unfortunately, modern web communication has numerous shortcuts, and one is known as "keep-alive".

Before I go further, the solution I found for your symptoms is to

  1. Remote into your node
  2. Open the IIS Manager
  3. Open "HTTP Response Headers" under "IIS"
  4. Click "Set Common Headers" on the right, and un-check the keep-alive option

Be forewarned, this will result in a higher number of hits to the Traffic Manager. Basically this requires a browser to check the DNS rule and open a new connection on each connection. This is needed because these open connections can survive PAST the TTL duration and any DNS cache destruction. Indeed, it's possible to extend these open connections further by hitting refresh. The exact opposite of what you want.

I know this answer is probably far too late for your use, so I apologize. However, I think it deserves an answer.

0
votes

According to the official documentation, it should route to the closest (in terms of latency) available DC.

https://docs.microsoft.com/en-us/azure/traffic-manager/traffic-manager-routing-methods

Can you try the test failover described in here: https://docs.microsoft.com/en-us/azure/traffic-manager/traffic-manager-testing-settings

0
votes

When I stop the first web app in Azure, and go to the trafficmanager URL, I get a 403 error page. What I want to happen is it to default to the second endpoint.

Azure traffic manager work as a DNS level load balancer. Azure Traffic Manager includes built-in endpoint monitoring and automatic endpoint failover, it periodically checks the health of every endpoint, including unhealthy endpoints. These DNS caching effects are common to all DNS-based traffic routing systems, so DNS level load balancer can't switch to another available site immediately.

Also traffic manager monitor settings will effect the time to switch to another available site.
The following timeline is a detailed description of traffic manager monitoring process.

enter image description here

More information about azure traffic manager monitor, please refer to this link.