Home > Software engineering >  How do I get a traceback of a HTTP500 from IIS running on Azure's "App Service" PaaS?
How do I get a traceback of a HTTP500 from IIS running on Azure's "App Service" PaaS?

Time:03-08

I've inherited an ASP.NET project with instructions to run it on Azure's App Service. I set up a pipeline to compile it (with debug in the Configuration param & system.debug=true of the compilation step), created a release to deploy it, but it doesn't run (returns a HTTP500.0 with error code 0x00000000). But try as I might, I can't get a proper traceback out of IIS.

I have tried:

  • Turning off CustomErrorMessages in Web.config; this just shows IIS's "an error occurred and for security we're hiding the details" HTTP500 page.
  • Viewing the live log feed in the "App Service Editor", then copy-pasting the html to view it (just gives generic error messages).
  • Downloading the Application logs as per Microsoft's guide; they're just generic HTTP500 pages with no trace.
  • Enabling "Application Insights" APM and viewing failures, but 0 failures are reported.

I'm stumped. How do I get the App Service variant of IIS to show me a simple traceback?

CodePudding user response:

  • Turn on Application Logging and Detailed error messages for the Web App in
    Azure Portal =>Your Web App =>App Service Logs, turn on the settings, make sure level is set to Error

enter image description here

  • The above settings will enable Application logging and start writing to log files into D:\home\LogFiles\Application.
  • To view Application Log, below App Service logs click Log stream.
  • Wait for some time to warm up and then refresh the page of the Web App.
  • Make sure you are viewing the Application logs and not the Web Server logs.
  • By navigating to Log stream and selecting Application Logs you could see a detailed error message
  • In web.config, add customErrors mode
<configuration>
   <system.web>
      <customErrors mode="Off"/>
   </system.web>
</configuration>

This will add the markup to the deployed web.config file and gives you detailed errors.

  • Restart the App and access the URL.

CodePudding user response:

The application stack trace is available in the logs, which can be viewed in "Advanced tools" menu of the App Service, or alternatively can be downloaded as a zip file as described in MSFT's instruction|. The relevant file that shows the stack trace inside this zipfile is eventlog.xml.

  • Related