在Azure App Service上运行部署后操作 [英] Run Post Deployment Action on Azure App Service

查看:49
本文介绍了在Azure App Service上运行部署后操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试-但没有成功-在Azure中的Web应用程序上运行部署后脚本.我已经创建了.sh和.cmd文件,并将它们放置在site \ deployments \ tools \ PostDeploymentActions中,但是这些文件在完成后不会运行.我要做的就是将SSH插入部署机器并运行1行代码:

 易于安装XXXX 

我尝试查看其他几个问题(

部署应用程序后(使用Ftp或Git轻松实现),最好采取一些措施.例如,发送电子邮件或将发行说明写到发行页面.我会做很多更奇特的事情-我会在控制台输出中写一些文本.

有关更多详细信息,请参阅文章(

步骤2.打开文件夹,检查部署状态.

如果遇到问题,可以设置 SCM_COMMAND_IDLE_TIMEOUT ACTIONS_ALLOW_UNSECURE_COMMANDS ,如果您有其他问题,可以访问google以获得详细信息,建议提高支持门户网站上的票.

I am trying - with no success - to run a post-deployment script on my webapp in Azure. I've created .sh and .cmd files, and placed them in site\deployments\tools\PostDeploymentActions, but the files don't run upon completion. All I'm trying to do is SSH into the deployment machine and run 1 line of code:

apt get install XXXX

I've tried looking at several other questions (How to add a custom post deployment script to azure websites?), but I can't re-create their success on my own machine.

It doesn't look like Azure has documentation on how to actually set up a post deployment action. And the only other resource I've found (https://github.com/projectkudu/kudu/wiki/Post-Deployment-Action-Hooks) hasn't given me success.

Has anybody else had success setting a post deployment action up? If so, can someone explain in very simple terms how to arrange it?

解决方案

Newest

Regarding this question, this Run Post Deployment Action works normally under both windows and linux. I have tried both of your posts. The answer below is running under windows, and the answer running under linux is in your other post.

In conclusion:

apt-get install xxx and pip install xxx are the environment variables for installing webapp. The Run Post Deployment Action on Azure mentioned in this article of yours. After testing, I found that azure is executed first during deployment deploy.sh file, and then execute my customized install_cmd.sh file.

The configuration of environment variables only needs to be configured once, and there is no need to execute each release. The specific test steps are in another post of yours.

After deploying application (that was easy with Ftp or Git) it would be nice to take some action. For example send an email, or write release notes to release page. I will do much fancier thing - I will write some text to console output.

For more details, you can refer the article(Azure post deployment scripts).

I tested it myself and it worked for me.

Step 1. Create .bat file under PostDeploymentActions folder.

Step 2. Open folder, check the status of deployment.

If you encounter issues, you can set SCM_COMMAND_IDLE_TIMEOUT and ACTIONS_ALLOW_UNSECURE_COMMANDS, you can go to google for details, if you have other issues, it is recommended to raise a support ticket on portal.

这篇关于在Azure App Service上运行部署后操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆