【问题标题】:How to get Azure DevOps pipeline manual cancellation call back如何获取 Azure DevOps 管道手动取消回调
【发布时间】:2020-12-22 07:08:39
【问题描述】:

我正在使用 Azure DevOps 管道来运行一些作业。此管道是使用 YML 创建的。

由于我正在使用我的 DevOps 管道调用 Azure 数据工厂管道,因此如果用户手动取消 DevOps 管道,在这种情况下,我的 Azure 数据工厂仍处于运行模式,这在理想情况下不应该发生。

有没有办法在从 UI 取消 Azure DevOps 管道时自动停止我的 Azure 数据工厂管道?

【问题讨论】:

    标签: azure azure-devops yaml


    【解决方案1】:

    作为一种解决方法,我们可以添加任务 power shell 任务并设置 custom condition canceled(),此任务只有在您取消构建时才会运行。

    然后添加power shell脚本调用the API取消Azure数据工厂管道。

    POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelineruns/{runId}/cancel?api-version=2018-06-01
    

    另外,我们可以通过 webhook 来实现,您也可以检查 blog 并更新 json。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-30
      • 2020-09-15
      • 2021-09-09
      • 2020-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多