question

Silvia-0038 avatar image
0 Votes"
Silvia-0038 asked ryanchill answered

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

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-webapps-content-deployment
5 |1600 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
0 Votes"
ryanchill answered

Hi @Silvia-0038,

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://docs.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.

5 |1600 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.