Azure 数据工厂在发布时禁用触发器

Azure Data Factory Disable Triggers On Release

我一直在尝试让数据工厂部署通过 VSTS 工作并且大部分时间都在那里,但由于需要禁用触发器才能被覆盖,所以我遇到了失败。以下错误消息:

Remove-AzureRmDataFactoryV2Trigger : HTTP Status Code: BadRequest
Error Code: TriggerEnabledCannotUpdate
Error Message: Cannot update enabled Trigger; it needs to be disabled first.
Request Id: <id number here>
Timestamp (Utc):06/17/2018 21:31:49
At line:1 char:1
+ Remove-AzureRmDataFactoryV2Trigger -ResourceGroupName "ResourceGroupName" -Data ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Remove-AzureRmDataFactoryV2Trigger], ErrorResponseException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.DataFactoryV2.RemoveAzureDataFactoryTriggerCommand

我在尝试直接部署和手动 运行 删除触发器的 powershell 脚本时都遇到了这个错误

Remove-AzureRmDataFactoryV2Trigger -ResourceGroupName "ResourceGroupName" -DataFactoryName "DataFactoryName" -Name "TriggerName"

我找不到通过 powershell 或在发布期间禁用触发器的方法。谁能帮我找到解决方法?没有它,我无法使用数据工厂进行持续集成发布。

谢谢

在删除之前调用 Stop-AzureRmDataFactoryV2Trigger。

迭代所有定义的触发器并设置为变量

$triggersADF = Get-AzureRmDataFactoryV2Trigger -DataFactoryName <DataFactoryName> -ResourceGroupName <ResourceGroupName>

禁用所有触发器

$triggersADF | ForEach-Object { Stop-AzureRmDataFactoryV2Trigger -ResourceGroupName <ResourceGroupName> -DataFactoryName <DataFactoryName> -Name $_.name -Force }

重新启用触发器post部署

$triggersADF | ForEach-Object { Start-AzureRmDataFactoryV2Trigger -ResourceGroupName <ResourceGroupName> -DataFactoryName <DataFactoryName> -Name $_.name -Force }