I've been trying to get Data Factory Deployments working through VSTS and am mostly there, but I'm getting a failure due to the triggers needing to be disabled to be overwritten. Error message below:
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
I get this error when both trying to do a straight deployment, but also when manually running a powershell script to remove the trigger
Remove-AzureRmDataFactoryV2Trigger -ResourceGroupName "ResourceGroupName" -DataFactoryName "DataFactoryName" -Name "TriggerName"
I cant find a way to disable a trigger via powershell or during a release. Can anyone help me find a way around this? Without it I cant do Continuous integration releases with the Data Factory.
Thanks
The Stop-AzDataFactoryV2Trigger cmdlet stops a trigger in a data factory. If the trigger is in the 'Started' state, the cmdlet stops the trigger and no longer invokes pipelines.
In case you're using ADF V2 and your pipeline is scheduled to run using a trigger, check which trigger your pipeline uses. Then go to the Manage tab and click on Author->Triggers. There you will get an option to stop the trigger. Publish the changes once you've stopped the trigger.
Tumbling window triggers are a type of trigger that fires at a periodic time interval from a specified start time, while retaining state. Tumbling windows are a series of fixed-sized, non-overlapping, and contiguous time intervals.
Azure Data Factory Triggers come in three different types: Schedule Trigger, Tumbling Window Trigger, and Event-based Trigger.
Call Stop-AzureRmDataFactoryV2Trigger before removing it.
Iterate round all defined triggers and set to variable
$triggersADF = Get-AzureRmDataFactoryV2Trigger -DataFactoryName <DataFactoryName> -ResourceGroupName <ResourceGroupName>
Disable all triggers
$triggersADF | ForEach-Object { Stop-AzureRmDataFactoryV2Trigger -ResourceGroupName <ResourceGroupName> -DataFactoryName <DataFactoryName> -Name $_.name -Force }
re-enable triggers post deployment
$triggersADF | ForEach-Object { Start-AzureRmDataFactoryV2Trigger -ResourceGroupName <ResourceGroupName> -DataFactoryName <DataFactoryName> -Name $_.name -Force }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With