Kenny_I
Kenny_I

Reputation: 2513

How to pass variable from main pipeline to child pipeline in Azure Data Factory?

I have set variable "Id" in main pipeline and I'm setting value in "Set Variable 1" I would like to pass variable to child pipeline. I have created parameter "Id" in child pipeline. However I cannot refer to @{variables('id')} in Lookup5 of Child pipeline.

How to pass correctly variable?

Main pipeline: Main pipeline

Child pipeline: Child pipeline

Upvotes: 2

Views: 4395

Answers (3)

D-Lock
D-Lock

Reputation: 11

  1. Go to your inner (child) pipeline
  2. Choose "Parameters" Tab
  3. Add a parameter, for example, childPipelineParam
  4. Go to your main pipeline
  5. Select your "execute pipeline" activity
  6. Choose "Settings" Tab
  7. in the "Value" field enter @variable("mainPipelineVariable"), or press "add dynamic content" and choose your variable from the list of all variables. Here "mainPipelineVariable" is the name of your variable you want to refer to the child pipeline.

Upvotes: 0

venus
venus

Reputation: 1258

Azure has a added a functionality to return parameter to the child pipeline using set variable activity. enter image description here

Here is the Azure Data Factory document link: Configure Pipeline Return Value in Child Pipeline

Or You can through a video for the quick help: How to Pass Values between Two ADF Pipelines

Upvotes: 0

ray
ray

Reputation: 15276

You should be able to pass the variable into the parameters of child pipeline. enter image description here

Simply access the passed in parameter with @{pipeline().parameters.Id} in the child pipeline. enter image description here

Upvotes: 4

Related Questions