Kenny_I
Kenny_I

Reputation: 2503

How to pass variable to Execute Pipeline in Azure Data Factory?

I would like to pass variable "year" from Foreach loop to Execute Pipeline. How to do it? Workarounds are welcomed if variables cannot be passed from pipeline to pipeline.

-Foreach Years (For example 2019,2020 etc) 1-Set variable year (2019) 1-Execute Pipeline 1--Azure Function Activity (Need year 2019 for json post) 2-Set variable year (2020) 2-Execute Pipeline 2--Azure Function Activity (Need year 2020 for json post)

Upvotes: 1

Views: 3909

Answers (1)

KarthikBhyresh-MT
KarthikBhyresh-MT

Reputation: 5034

I think you already are on the right track.

  • Store the years in an array variable.
  • In ForEach Activity iterate over this array and use Execute Pipeline Activity.
  • Remember, to pass a parameter to the child pipeline - the one being executed through Execute pipeline activity, it must have the pipeline parameter.

Once you have it created, it will automatically pop up in Execute pipeline activity properties. You can the pass the parameter received in JSON body to Azure function app call.

enter image description here

Upvotes: 3

Related Questions