question

TejasMorkar avatar image
0 Votes"
TejasMorkar asked ·

Container xyz didn't respond to HTTP pings on port: 8080, failing site start.

I have a simple node.js app that runs a discord bot using discord.js library. This node app does not require any request or query to run, but when I deployed it to the Azure App Services on a Linux environment, it starts perfectly and then shuts down in a few seconds with an error saying - Container didn't respond to HTTP pings on port: 8080, failing site start.

I just added express and made the app respond with "Hello World" on HTTP ping by listening to 8080 port. Now there is no such error and it runs fine.

So is there any other fix for this without needing to listen to port 8080?

azure-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ryanchill avatar image
1 Vote"
ryanchill answered ·

Hi @TejasMorkar,

App Service looks for a listening port to bind to, so it knows where to forward the web requests. It looks to me that a continuous web job would be better fit to run your node app. See https://docs.microsoft.com/en-us/azure/app-service/webjobs-create and https://github.com/projectkudu/kudu/wiki/WebJobs for more details.

If you run into issues or need any further clarification, please feel free to comment down below.

Regards,
Ryan

· 3 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the quick answer.

I was looking into webjobs as suggested by you. On azure portal it asks to upload a zip file in webjobs.
My nodejs project has index.js and a few other files like package.json and node_modules folder. What should I upload for the webjob? I have created a new Windows based app service and have deployed nothing to it yet.

0 Votes 0 ·

You can zip the contents of your dist folder or whatever your build output is set to and drop that as a webjob.

Regards,
Ryan

1 Vote 1 ·

Thanks for the help!
It's working as expected now. I just zipped the node_modules folder and index.js file and uploaded it to the webjob.

1 Vote 1 ·