Now I can deploy from VSTS to azure, but I can't run npm after deploy is successful.
Now it is work like -> run npm install for branch files => zip => copy to azure => deploy.
I want to add npm run custom-comand to end of this chain. How to do it?
Customize build automationRun npm install without any flags, which includes npm preinstall and postinstall scripts and also installs devDependencies . Run npm run build if a build script is specified in your package. json. Run npm run build:azure if a build:azure script is specified in your package.
Deploy a ZIP package to your web app by using the az webapp deploy command.
The Azure App Service Deployment task in VSTS now supports a post-deployment script. Here is a screen-shot from version 3.* of the task:
See Task Parameters for more details.
Windows App Services users: Watch out for an npm bug that prevents multiple npm
commands from being run (inline or in a script). For example:
npm install
npm test
Will only run npm install
. There are several workarounds including this:
npm install & npm test
There is no out of box build task to achieve the feature you want. If you do want to run the npm from Azure App Service:
Manually: You can go to Kudu console of the App Service and run npm command there:
Automatically: You need to create your own build task to run the npm command via Kudu Rest API
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With