【问题标题】:How to invoke Powershell script from post-deployment approvals/Post-deployment gates in Azure DevOps如何从 Azure DevOps 中的部署后批准/部署后门调用 Powershell 脚本
【发布时间】:2021-03-11 08:31:19
【问题描述】:

我在 Azure DevOps 中有构建管道和发布管道,它们运行良好。我想使用 repo 中的 power shell 脚本启动网站,只有在发布管道中的部署后批准之后。做一些初步的手动检查并启动网站

发布管道

Task 1: stop website

Task 2: deploy website

Do initial Manual checks before starting the website

Task 3: Start website using post-deployment approvals

【问题讨论】:

  • 嗨,您有机会查看以下答案吗?进展如何?

标签: powershell azure-devops release


【解决方案1】:

恐怕无法从部署后的审批中调用powershell脚本。

但是,如果您的网站部署到 azure 资源。您可以通过从部署后的门调用 Azure 函数来运行 powershell 脚本。您将需要创建一个 Azure 函数来使用 powershell 脚本启动网站。参见文档Create a PowerShell function in Azure using Visual Studio Code

还有另一种解决方法,使用 Manual intervention task 而不是部署后批准。

您可以添加agentless job在网站部署后运行手动干预任务(通知用户批准)。

然后运行 ​​power shell 脚本以在下一个作业中启动您的网站,如下所示:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-14
    • 1970-01-01
    • 1970-01-01
    • 2021-03-01
    • 1970-01-01
    • 2017-08-18
    • 2017-07-16
    • 1970-01-01
    相关资源
    最近更新 更多