Azure Web App on Linux Container didn’t Respond to HTTP Pings on Port 8080 when Using Start pm2 start Server.js

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 ERROR - Container crime-digest__6ea5_0 for site crime-digest__6ea5 has exited, failing site start
2019-04-15 11:36:34.489 ERROR - Container crime-digest__6ea5_0 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.

Container logs have nothing but the above error.

If I use just: "start": "node server.js", the app starts just fine.

I understand that if the container doesn’t respond via 8080 the container gets stopped, but I’m having process.env.PORT set as the port of my server so I can’t figure out why the pm2 start script crashes the container.

I have a feeling that process.env.PORT is undefined if using the above start script because of some mix-up in the process but can’t find any way to debug it because after the container crashes I’m unable to sash into it any more to inspect it.

This Post Has One Comment

  1. No Fault

    When enforcing HTTPS at the App Service level, TLS termination will happen and traffic will be routed to your container port so there’s no need to enforce TLS from your container.

    If your container listens on another port (ex: 8081), simply set the WEBSITES_PORT application setting to that port number. App Service will listen on port 80 and forward traffic to your container port.

Leave a Reply