question

emeric-lallement avatar image
0 Votes"
emeric-lallement asked Pranay-9917 commented

CICD One scope parameter for two triggers

Hi!
I'm trying to create an unique Release pipeline for my ADF.
I'm facing an issue with triggers because each trigger have his own scope and each new trigger need me to modify the release pipeline.

I try to modify my ARM parameter configuration :
84894-image.png
But it doesn't work :
84866-image.png

My goal is to have only one parameter for 2 triggers.

I would like to know if it's possible to have something like a global variable or an unique scope parameter in template for multiple triggers.

Is it possible ?
Thanks


azure-data-factory
image.png (6.3 KiB)
image.png (24.9 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@emeric-lallement : Its not officially supported, but a workaround is to write a powershell script.

  1. You need to change the parameters.

  2. Then save them in a temp file which will be later used in your CICD pipelines for deployment.

Could you add your files: pls remove the Subscription and all important values (add test)

Thanks

1 Vote 1 ·

Hi,
Thanks for your reply,
I don't understand your workaround. Can you give me more detail for this process ? Or may be a link ?

0 Votes 0 ·

@emeric-lallement - Following up to see f the below suggestion from @Pranay-9917 was helpful. If it answers your query, please do click “Accept Answer” and/or Up-Vote, as it might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

Thanks

0 Votes 0 ·
Pranay-9917 avatar image
1 Vote"
Pranay-9917 answered Pranay-9917 commented

@emeric-lallement :

I didn't put it in my git yet so don't have a link.. I am adding few things to get started. let me know if that works else, I will update my code and add to my git.

Nonetheless, I can send you few things to get started:

You have 2 files from ADF branch (not the master):
- ARMtemplate.json
- parameters.json

Read the file
$armFile = Get-ChildItem -Path $rootPath -Recurse -Filter "ARMTemplateForFactory.json" | SELECT -First 1

------ > create an empty ARM Template: ARMTemplate_wReplacedValues.json
$armFileWithReplacedValues = $armFile.FullName.Replace($armFile.Name, "ARMTemplate_wReplacedValues.json")

$json = Get-Content $armFile.FullName -raw | ConvertFrom-Json

------ > As you have to use only one parameter for all. You need to create an additional parameter in your new temporary ARM Template.

foreach ($n in $json.parameters) {
$n | Add-Member -Type NoteProperty -Name 'ValueForAll' -Value @{
type= "String"
defaultValue= $valuefromparamtersfile
}
}

------ > Use this to get the exact field from the json
foreach ($n in $json.resources){
$json.update | % { if (<add condition >){
$n.properties.typePropertie = '[parameters(''valuefromparamtersfile'')]'
}
}
}

$json | ConvertTo-Json -depth 100 | Out-file $armFileWithReplacedValues

Try it locally first, before working with build pipeline.

Let me know If that works.

Regards
Pranay

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks,
It's similar to deploying global parameters : https://docs.microsoft.com/fr-fr/azure/data-factory/author-global-parameters#deploying-using-powershell

I'm also experimenting this process.
Thanks, I'm trying to implement your solution next week.

0 Votes 0 ·

@emeric-lallement sure, let me know if you have issues.

FYI: Locally if you are using powershell ISE. You might run in to problems.

Solution: Use Powershell Core i.e. version 7. Can. easily do that in VS Code.

Regards
Pranay

0 Votes 0 ·
KranthiPakala-MSFT avatar image
0 Votes"
KranthiPakala-MSFT answered KranthiPakala-MSFT commented

Hi @emeric-lallement

As Pranay mentioned unfortunately it is not possible to have unique scope parameter in template for multiple triggers. I have double checked with product team and confirmed the same.

You could try the workaround suggested by Pranay and see if that helps.

If you have any feedback or suggestion regarding the feature, I would recommend to share it in ADF user voice forum: https://feedback.azure.com/forums/270578-azure-data-factory.

All the feedback shared in this forum are actively monitored and reviewed by ADF engineering team. Do share the feedback link once it is posted so that other users with similar idea can up-vote and comment on your suggestion to help increase the feature implementation.

Hope this helps.



Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @emeric-lallement,

Just checking in to see if the above info was helpful. If it answers your query, please do click “Accept Answer” and/or Up-Vote, as it might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

Thank you

0 Votes 0 ·