Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerShell Script produced by azure-data-factory-utilities doesn't account for parameterised runtime state of triggers #387

Open
crystalgeek opened this issue May 18, 2022 · 8 comments

Comments

@crystalgeek
Copy link

crystalgeek commented May 18, 2022

I am having a problem with the recommended CI/CD for ADF. Using the azure-data-factory-utilities package.

When ADF trigger runtimestate is included in the arm-template-parameters-definition.json file
"Microsoft.DataFactory/factories/triggers": { "properties": { "runtimeState": "=",

This produces an ARMTemplate which adds parameters to the runtimeState property ARMTemplateForFactory.json
{ "name": "[concat(parameters('factoryName'), '/BlobTrigger')]", "type": "Microsoft.DataFactory/factories/triggers", "apiVersion": "2018-06-01", "properties": { "annotations": [], "runtimeState": "[parameters('BlobTrigger_properties_runtimeState')]",

The powershell script for Pre/Post Deployment PrePostDeploymentScript.ps1 is expecting the runtimeState to be "Started" when defining triggers to start. This means that if parameterised these triggers don't get started even if they were previously

$triggersToStart = $triggersInTemplate | Where-Object { $_.properties.runtimeState -eq "Started" -and ($_.properties.pipelines.Count -gt 0 -or $_.properties.pipeline.pipelineReference -ne $null)} | ForEach-Object { New-Object PSObject -Property @{

@Hao-Microsoft
Copy link

Which azure-data-factory-utilities package are you using? Please share the location of the package.

@crystalgeek
Copy link
Author

crystalgeek commented May 27, 2022 via email

@crystalgeek
Copy link
Author

@microsoft/azure-data-factory-utilities

This npm package as described here

https://docs.microsoft.com/en-gb/azure/data-factory/continuous-integration-delivery-improvements#continuous-deployment-improvements

@dsfrederic
Copy link

I'm facing the same issue. @Hao-Microsoft the script should be updated to take parameters into account

@Hao-Microsoft
Copy link

@crystalgeek and @dsfrederic , we are aware of this issue and will be working on the fix.

@dsfrederic
Copy link

In PR #433 I've provided a fix

@Hao-Microsoft
Copy link

Awesome thank you @dsfrederic ! It looks like you are already using the newer/better scripts. We'll fix this issue for both.

@soma-ms
Copy link
Contributor

soma-ms commented Sep 28, 2022

The issue has been fixed now in both places - in this repository (PrePostDeploymentScript.Ver2.ps1), and in npm package (version 1.0.0). If you are using NPM package, the fix is available only in the latest version and should use build-preview command as:
https://learn.microsoft.com/en-us/azure/data-factory/continuous-integration-delivery-improvements#create-an-azure-pipeline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants