简体   繁体   中英

Container didn't respond to HTTP pings on port: 8080, failing site start. Azure Linux web service

I created a Nodejs application (ExpressJS) on Azure using the Linux web app service. I managed to deploy the code through Kudu and it was successful. After some code changes, the container didn't respond to HTTP pings on port. I have added the WEBSITES_PORT 8080, PORT 8080 and WEBSITES_CONTAINER_START_TIME_LIMIT: 1800 but no luck. Below is the screenshot for the api log stream. Can you help me guys?

api log stream screenshot

Node version: 10.10

    {
      "name": "app-v1",
      "version": "0.0.0",
      "private": true,
      "scripts": {
        "start": "NODE_ENV=production node ./bin/www",
        "dev": "NODE_ENV=production nodemon ./bin/www"
      },
      "dependencies": {
        "bcrypt": "^3.0.7",
        "body-parser": "^1.19.0",
        "cookie-parser": "~1.4.4",
        "cors": "^2.8.5",
        "debug": "~2.6.9",
        "dotenv": "^8.2.0",
        "express": "~4.16.1",
        "express-async-handler": "^1.1.4",
        "http-errors": "~1.6.3",
        "jade": "~1.11.0",
        "jsonwebtoken": "^8.5.1",
        "morgan": "~1.9.1",
        "mysql2": "^2.1.0",
        "passport": "^0.4.1",
        "passport-local": "^1.0.0",
        "sequelize": "^5.21.3"
      },
      "devDependencies": {
        "nodemon": "^2.0.2"
      }
    }

I had exactly the same problem and couldn't work out what was going on. I just wanted a Linux App Service to run some Javascript each time the service was started but I got the error couldn't ping 8080 on start.

Creating the nodejs express application works fine: https://docs.microsoft.com/en-gb/azure/app-service/containers/quickstart-nodejs

This implies the nodejs application needs to have port 8080 open. I'll work on a solution that requires minimal install so you won't need the express generator and post how do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM