How to debug startup Errors on Azure App Service

Viewed 3913

I am getting this error when my App Service starts on Azure:

An error occurred while starting the application.

I have not been able to find any relevant errors in the event logs.

How can I debug this?

1 Answers

I found this page very helpful:

In particular, there is a tool in Azure called Kudu Services (Under Development Tools/Advanced Tools) which lets you open a command prompt for your site, and then run dotnet your.dll

This will show you the exact error message that is occurring as if you were running it on your own localhost with all output.

Steps:

  1. Open Kudo
  2. Go to DEBUG CONSOLE (Top Menu), then CMD
  3. This will open a black command window.
  4. CD site
  5. CD wwwroot
  6. DIR to list contents. Find your dll in the list to ensure you are in the right location.
  7. DOTNET your.dll

The site will then start up, or fail to start. If it fails, it will show the relevant messages so you can debug.

Related