1
votes

I have the following rewrite code in my web.config (MVC 5) which is apparently causing the traffic manager to register "degraded" since it gets the rewrite (301 status, I suspect). I have set the traffic manager to monitor HTTPS. What else do I need to do?

  <system.webServer>
<!-- http://blog.smarx.com/posts/redirecting-to-https-in-windows-azure-two-methods -->
<!--<rewrite>
  <rules>
    <rule name="Redirect to HTTPS" stopProcessing="false">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
        <add input="{URL}" pattern="/$" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
      </conditions>
      <action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="SeeOther" />
    </rule>
  </rules>
</rewrite>-->
<validation validateIntegratedModeConfiguration="false" />

UPDATE This may work in my home controller:

    /// <summary>
    /// For Azure Traffic Manager Monitoring /Home/TrafficManagerProbe
    /// </summary>
    /// <returns></returns>
    [HttpGet]
    [AllowAnonymous]
    public HttpResponseMessage TrafficManagerProbe()
    {
        return new HttpResponseMessage(HttpStatusCode.OK);
    }
2

2 Answers

1
votes

Your suspicion is correct. The Azure Traffic Manager health probes must receive an HTTP '200' to consider the endpoint to be online. Any other HTTP status (including 201, 202 etc) are considered degraded. Re-directs (301, 302 etc) are not followed.

This article has more info on how to troubleshoot degraded endpoint status.

0
votes

The following works for the above case where Https is required. Just add /Home/TrafficManagerProbe as the monitor link at the bottom of the TrafficManager configuration page. I now get "available" instead of "degraded".

/// <summary>
/// For Azure Traffic Manager Monitoring /Home/TrafficManagerProbe
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public HttpResponseMessage TrafficManagerProbe()
{
    return new HttpResponseMessage(HttpStatusCode.OK);
}