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?
Log detailed errors To save the error page or failed request tracing for Windows apps in the Azure portal, navigate to your app and select App Service logs. Under Detailed Error Logging or Failed Request Tracing, select On, then select Save.
In Solution Explorer, right-click the project, and click Publish. In the Profile drop-down list, select the same profile that you used in Create an ASP.NET app in Azure App Service. Then, click Settings. In the Publish dialog, click the Settings tab, and then change Configuration to Debug, and then click Save.
To specify a startup command or command file: Azure portal: select the app's Configuration page, then select General settings. In the Startup Command field, place either the full text of your startup command or the name of your startup command file. Then select Save to apply the changes.
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:
DEBUG CONSOLE
(Top Menu), then CMD
CD site
CD wwwroot
DIR
to list contents. Find your dll in the list to ensure you are in the right location.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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With