azure-web-app-serviceasp.net-core-mvc

How do I get the details of an Error 500 for an Azure Web App?


I have an MVC 6 site that has been deployed as an Azure Web App. I have enabled all tracing / diagnostic options in Visual Studio using Server Explorer. I am trying to do remote debugging, but I am only seeing an Error 500 on my browser, and not finding any information (or triggering an error breakpoint) on where exactly the error occurred.

I can't find any error trace on the file logs that I get from Azure.

How should I troubleshoot Error 500's in an Azure Web App?

Adding "CustomErrors": {"Mode": "Off"} to config.json didn't work.


Solution

  • For MVC 6 you need to add a web.config file to the wwwroot folder with the following:

    <configuration>
       <system.web>
          <customErrors mode="Off"/>
       </system.web>
    </configuration>
    

    That will add the markup to the deployed web.config file, and give you detailed errors. See http://docs.asp.net/en/latest/fundamentals/diagnostics.html#http-500-errors-on-azure for more details.