Search code examples
azureasp.net-mvc-5azure-web-app-service

How to resolve error 500 on Azure web app?


What I have:

  • VS2015U2
  • ASP.NET 5 MVC 6 website
  • Deployed to Azure Web App
  • The site works locally
  • When I deploy to Azure I get internal server error (500)
  • I'm unable to Attach a debugger since they messed up something with the latest versions (tried manually too https://azure.microsoft.com/en-us/blog/introduction-to-remote-debugging-on-azure-web-sites/)
  • I have app.UseDeveloperExceptionPage(); but I guess the site is failing during configuration so it doesn't display any other information.

So how to resolve this? I need to see the .net exception but I have no idea how to do that.


Solution

  • Try adding Application Insights to the app. You should see errors on startup of your application.

    I would also take a look at your startup code to see if you are writing to disk anywhere during configuration or app.start. This might be the case if you are using AAD in any capacity.

    You can also hit up the KUDU console by targetting https://sitename.scm.azurewebsites.net . You will be able to navigate in the debugging console to see the RAW logs from IIS. That might shed some light into the situation. See KUDU for more info.