在发布任务期间,在Web应用程序上运行Azure Powershell脚本 [英] Running azure powershell script on web app during release task
问题描述
在执行部署到天蓝色的站点"任务之后,我的VSTS版本中正在运行天蓝色的Powershell任务".在powershell脚本中,我需要执行一些转换,这些转换都需要在网站上的多个文件上运行,这些都基于部署变量.
I have an 'azure powershell task' running in my VSTS release after my 'deploy to azure site' task. In the powershell script, i have some transformations that i need to run on several of the files on the website, all based on the deployments variables.
问题是我找不到网站的目录.运行任务的根目录如下:
The problem is I can't find the directory for the website. The root directory that the task is run under is something like:
D:\ a_tasks \ AzurePowerShell_71a1931a-effb-3d2e-8fd8-f7472a07cb62 \ 3.1.18 \
D:\a_tasks\AzurePowerShell_71a1931a-effb-3d2e-8fd8-f7472a07cb62\3.1.18\
我如何将其指向d:\ home \ site \ wwwroot \,是否有一个build/release变量可以自动选择部署站点的位置?还是我可以只写出'd:\ home \ site \ wwwroot \'并期望将来不会改变?
how do i point it to the d:\home\site\wwwroot\ , is there a build/release variable that automatically picks the deployment site location? Or can i just write out 'd:\home\site\wwwroot\' and expect that to not change in the future?
推荐答案
那不是它的工作原理(如果我对的话).您的脚本将在您的build \ release代理上运行,而不是在Webapp上运行.您将需要使用本机kudu功能来实现您想要实现的目标: https://github.com/projectkudu/kudu/wiki/Custom-Deployment-Script
thats not how it works (if I got you right). your script will run on your build\release agent, not on the webapp. You would need to use native kudu capability to achieve what you want to achieve: https://github.com/projectkudu/kudu/wiki/Custom-Deployment-Script
这篇关于在发布任务期间,在Web应用程序上运行Azure Powershell脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!