CICD One scope parameter for two triggers

Emeric 21 Reputation points
2021-04-06T11:00:37.72+00:00

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
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,517 questions
{count} votes

Accepted answer
  1. Pranay 291 Reputation points
    2021-04-12T14:03:59.06+00:00

    @Emeric :

    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

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,422 Reputation points Microsoft Employee
    2021-04-07T19:30:57.363+00:00

    Hi @Emeric

    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.