问题
After re publishing my application (which has always worked just fine) I am no longer able to navigate to my site, with this error:
This page isn’t working
mysite.azurewebsites.net redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS
And I get this unbelievably annoying error message in the log stream as soon as I navigate to the site:
System.ApplicationException: The trace listener AzureBlobTraceListener is disabled. ---> System.InvalidOperationException: The SAS URL for the cloud storage account is not specified. Use the environment variable 'DIAGNOSTICS_AZUREBLOBCONTAINERSASURL' to define it.
at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.RefreshConfig() --- End of inner exception stack trace ---
What is all this about? I have no idea what AzureBlobTraceListener
is, and I have no need for it. How can I just remove this irritant from my life?
I am not using cloud storage - my app is just simply authenticating against O365, then redirecting to the site. It works fine when debugging from VS.
update
F12 network logs (not sure how to post these as it doesnt let me copy and paste the logs, which is pretty ridiculous):
In my BaseController
I have this action for handling errors
protected override void OnException(ExceptionContext filterContext)
{
if (filterContext.ExceptionHandled)
{
return;
}
var logger = new Logger();
logger.LogError(filterContext.Exception, ControllerContext.RouteData.Values["controller"].ToString());
filterContext.Result = new ViewResult
{
ViewName = "~/Views/Shared/Error.cshtml",
ViewData = new ViewDataDictionary()
{
{"exception", filterContext.Exception}
}
};
filterContext.ExceptionHandled = true;
}
Error.cshtml
@{
var exception = (Exception)ViewData["exception"];
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Error</title>
</head>
<body>
<h1>Error.</h1>
<h2>An error occurred while processing your request.</h2>
<p>@exception.Message</p>
</body>
</html>
来源:https://stackoverflow.com/questions/50402715/too-many-redirects-and-azureblobtracelistener