My App Service Linux instance crashes if my node app is using the start script: \"start\": \"pm2 start server.js\"
:
2019-04-15 11:36:34.432 ERRO
Are we trying to ping on PORT 8080? The problem here is that port 8080 is not exposed, so when we attempt to ping the container, we aren't pinging on a port on which the container is listening.
There are a couple of ways to resolve this.
You can refer the below mentioned articles:
https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-rm-web-app-deployment?view=azure-devops
https://blogs.msdn.microsoft.com/waws/2017/09/08/things-you-should-know-web-apps-and-linux/
I was having the same issue. When I changed the code in my server.js file to the below it succesfully ran:
const port = process.env.port || 8080;
After redeploying to Azure it is now working.
Try adding the application setting PORT with the value of whatever port your app is listening on.
Ref: https://github.com/MicrosoftDocs/azure-docs/issues/34451