Too many redirects and AzureblobTraceListener

半腔热情 提交于 2020-01-17 00:43:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!