How can I run npm command on azure app service after successfully deploying VSTS?

Now I can deploy from VSTS to azure, but I cannot run npm after successful deployment.

Now it works like -> run npm install on branch files => zip => copy to azure => deploy.

I want to add npm run custom-comand to the end of this chain. How to do it?

enter image description here

+2


source to share


3 answers


There is no box-less assembly task to achieve the required function. If you want to run npm from Azure App Service:

In manual mode: you can go to the Kudu console of the App service and run the npm command there:enter image description here



Automatic: you need to create your own build task to run npm command via Kudu Rest API

+1


source


You can run commands like npm install

through Kudu REST API .

Here's a script written in PowerShell .



Add a PowerShell script task after the Azure App Service Deploy task to invoke npm install

(or any other command supported by Kudu). And disable the npm install task in the build pipeline.

+1


source


You can use PowerShell task or npm task to execute npm commands.

Of note: you also need to upload .npmrc

with auth token to Azure.

0


source







All Articles