Troubleshooting HTTP 502.5 startup issues in Azure AppService for ASP.NET Core Websites
Whenever ASP.NET Core website fails to start in Azure AppService we get HTTP
502.5 error and this below error page
To troubleshoot this startup error, we need to capture addition logs.
Here are the steps to capture logs :
1.
Go to SCM site, just add .scm before .azurewebsites.net in
the URL as shown below
In the SCM website, click on the Debug Console | CMD
Click on Site | WwwRoot folder
Look for web.config file, now click on the pencil icon to edit it
Change the web.config as highlighted below
<aspNetCore processPath="dotnet" arguments=".\webapp.dll" stdoutLogEnabled="true" stdoutLogFile="\\?\%home%\LogFiles\stdout"> </aspNetCore>
Now, try to browse to the home page of your website
You should see same startup failure error message
Go back to SCM website
Navigate to d:\home\Logfiles
You should now see stdout_xxx_datetime.log as shown below
Click on the pencil icon to view it.
You should see the callstack and line # of the exception
as shown below