Azure Web Apps - how to run script before deployment

…衆ロ難τιáo~ 提交于 2019-12-04 18:04:31

How can I run a script upon first deployment and after each Git-push-triggered deployment?

First, you need to generate custom deployment script by using azure-cli tool.

1) Set the cli working mode to asm.

azure config mode asm

2) Run the custom deployment script generator command.

azure site deploymentscript --node -t bash

This will generate the files required to deploy your site.

  • .deployment - Contains the command to run for deploying your site.
  • deploy.sh - Contains the deployment script.

Now you can edit the deploy.cmd file and add your custom steps.

After that done, add the generated files to your repository (.deployment and deploy.sh) and push your repository to your Azure Web App and see your custom deployment running.

For more details, please refer to this blog post.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!