Azure数据工厂在版本

时间:2018-06-17 21:59:20

标签: powershell azure-devops azure-powershell azure-data-factory azure-data-factory-2

我一直在努力让数据工厂部署通过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或在发布期间禁用触发器的方法。任何人都可以帮我找到解决方法吗?没有它,我无法与数据工厂进行持续集成发布。

由于

1 个答案:

答案 0 :(得分:6)

在删除之前调用Stop-AzureRmDataFactoryV2Trigger。

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

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

禁用所有触发器

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

在部署后重新启用触发器

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