Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Data Factory Disable Triggers On Release

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

like image 271
DataNovice Avatar asked Jun 17 '18 21:06

DataNovice


People also ask

How do you stop a trigger in a data factory?

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.

How do you pause Triggers in ADF?

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.

What is tumbling trigger in Azure Data Factory?

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.

How many types of Triggers are there in Azure Data Factory?

Azure Data Factory Triggers come in three different types: Schedule Trigger, Tumbling Window Trigger, and Event-based Trigger.


1 Answers

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 }
like image 77
Fang Liu Avatar answered Sep 22 '22 13:09

Fang Liu