Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

544
Visualizações
How to deploy nodejs expressjs app in Azure with CI/CD?

I'm trying to deploy a nodejs with expressjs app. My pipeline is this:

enter image description here

This create a correct artifact:

enter image description here

We can check here:

enter image description here

Now I create this release that uses the artifact I mentioned previously:

enter image description here

The steps in release:

enter image description here

And after release executed(success) in appname.scm.azurewebsites.net in wwwroot folder I have the right files:

enter image description here But application never start because I never tell how start I think.

What would I put in Post deployment action? node server/server.js? (server.js is in server folder), npm start? In my package.json if I use npm start, then it going to run node server/server.js. Because in local, if I will run my app I have to execute npm start or node server/server.js

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

In the package.json file, normally you set the main file, "main": "server.js", in your case I think you should define main as "main": "server.js" and move the server.js file from the server directory to project root directory.

If you look at the log stream, normally to start the project, azure runs node server or something you defined in the package.json as main.

I have pasted some parts of the azure log stream here so you can see what happens in the azure:

2022-05-09T18:19:04.222521897Z # Enter the source directory to make sure the script runs where the user expects
2022-05-09T18:19:04.222528898Z cd "/home/site/wwwroot"
2022-05-09T18:19:04.222535898Z
2022-05-09T18:19:04.222542298Z export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
2022-05-09T18:19:04.222548498Z if [ -z "$PORT" ]; then
2022-05-09T18:19:04.222554799Z      export PORT=8080
2022-05-09T18:19:04.222561899Z fi
2022-05-09T18:19:04.222783509Z
2022-05-09T18:19:04.222805710Z node server.js
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda