Error deploying Node.js, amplify and vue app on Azure App Service

Anonymous
2021-07-15T12:05:03.73+00:00

Hi,

I am trying to deploy an application to Azure App Service. The app uses Node.js, Vue and AWS Amplify.
The deployment is done using a local git and pushing to a remote.

The package.json has the scripts:
"scripts": {
"start": "vue-cli-service serve",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"i18n:report": "vue-cli-service i18n:report --src \"./src//.?(js|vue)\" --locales \"./src/locales//.json\""
},

Even though the deployment seems correct, the app doesn't respond giving the next error:

ERROR - Container XXXXXX for site XXXXXX did not start within expected time limit. Elapsed time = 230.2496671 sec
ERROR - Container XXXXXX didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.

I've added an application setting named WEBSITES_PORT with value 8080 but it didn't work either.

Right now the app is not responding and logs show nothing.

I'd appreciate any help.
Thank you!

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,782 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 28,191 Reputation points Microsoft Employee
    2021-07-15T18:32:06.28+00:00

    Hi @Anonymous ,

    Make sure your app is listening on the PORT environment variable? e.g.

       const port = process.env.PORT || 3000  
       app.listen(port, () => {  
         console.log(`Example app listening at http://localhost:${port}`)  
       })  
    

    The platform should automatically run your start script from package.json but just to be sure, you can set the startup via az webapp config set --resource-group <resource-group-name> --name <app-name> --startup-file "npm run start"; see https://learn.microsoft.com/en-us/azure/app-service/configure-language-nodejs?pivots=platform-linux for more details. Also check your container logs at https://<app-name>.scm.azurewebsites.net/api/logs/docker for any issues during startup that may have occurred during container startup.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.