I had published a new .NET Core 2.0 web app to Azure App Service and hit this error.
Hitting the site:
HTTP Error 502.5 - Process Failure
Common causes of this issue: The application process failed to start
The application process started but then stopped The application
process started but failed to listen on the configured port
Debugging:
Using Azure Application Insights & the App Service - Advanced Tools (KUDU) looking at the Tools - Debug Console - Browsing the LogFiles folder eventlog.xml had a log row:
Application 'MACHINE/WEBROOT/APPHOST/xxxx' with physical root 'D:\home\site\wwwroot\' failed to start process with commandline 'dotnet .\WebApp.dll', ErrorCode = '0x80004005 : 8000808c.
<Provider Name="IIS AspNetCore Module"/>
<EventID>1000</EventID>
<Level>1</Level>
<Task>0</Task>
<EventData>
<Data>Application 'MACHINE/WEBROOT/APPHOST/xxxx' with physical root 'D:\home\site\wwwroot\' failed to start process with commandline 'dotnet .\WebApp.dll', ErrorCode = '0x80004005 : 8000808c.</Data>
</EventData>
</Event>
Solution
This answer: Deleting the wwwroot folder in azure and publish again from VS, worked for me despite not having a legacy Core 1.1 app initially.
Launch Azure Console within the app and delete the contents of the wwwroot folder then redeploy.
RMDIR wwwroot /S /Q
Further testing
Following this was very helpful for testing and it works when followed identically, then deviate however you need to find errors.
https://docs.microsoft.com/en-us/aspnet/core/tutorials/publish-to-azure-webapp-using-vs