无法使用CI / CD在ADF v2中部署TumblingWindowTrigger

时间:2020-03-11 18:12:30

标签: azure azure-devops azure-pipelines-release-pipeline azure-data-factory-2

当前,我们具有CI / CD发布管道设置,用于按照documentation从开发到测试数据工厂的部署ADF V2代码。在Azure DevOps中运行发布管道时,失败并显示以下错误

    {
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'.",
    "details": [
      {
        "code": "DeploymentFailed",
        "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",
        "details": [
          {
            "code": "BadRequest",
            "message": "{\r\n  \"error\": {\r\n    \"code\": \"TumblingWindowTriggerStartTimeUpdateNotAllowed\",\r\n    \"message\": \"Update of start time for tumbling window trigger is not allowed.null\",\r\n    \"target\": null,\r\n    \"details\": null\r\n  }\r\n}"
          }
        ]
      }
    ]
  }
}

是否有任何解决方法可将ARM模板部署到测试ADF,而无需更新或参数化滚动窗口触发器的StartTime?

非常感谢您的帮助!

2 个答案:

答案 0 :(得分:0)

我没有设法更新这样的触发器。但是为了防止部署问题,我根据参数向触发器添加了条件。

参数定义

 "isNewDeployment": {
  "type": "bool",
  "defaultValue": true
}

条件

"condition": "[parameters('isNewDeployment')]"

然后根据您是否要部署触发器来调整部署的参数文件

"isNewDeployment": {
  "value": false
}

答案 1 :(得分:0)

这对我来说是同样的问题。

虽然我写了另一个脚本,它在 ARM 模板中检查触发时间,然后在 DataFactory 中检查。

  1. 如果时间匹配,它就会部署!
  2. 否则它会检查触发器是否处于活动状态。 -- 如果激活:检查最新的触发器运行时间,添加 ARM 模板并删除触发器。 -- 如果处于非活动状态:删除触发器并使用新时间进行部署。

注意:删除很重要,否则您可能无法部署触发器。 我使用了类似的方法:放置参数,即是否必须完成部署。

你可以看看:https://github.com/pranayyt/Azure.TumblingWindowTriggerStartTime

Atm 在多个数据工厂环境中运行流畅。

希望这会有所帮助。干杯。