Hi @eric2, In Azure Data Factory (ADF), you must use pipeline parameters to pass variables from a parent pipeline to a child pipeline. You can define parameters in your child pipeline and then pass the variable values when you execute the child pipeline from the parent pipeline.
Here are the steps to do it:
1. Define parameters in your child pipeline:
- In your child pipeline, go to the ’Parameters’ tab and add a parameter. For example, you can name this parameter Datetime
.
2. Pass the variable values from the parent pipeline:
- In your parent pipeline, when you add the ’Execute Pipeline’ activity to call the child pipeline, you can pass the variable's value to the child pipeline. In the ’Parameters’ tab of the ’Execute Pipeline’ activity, add the same parameter Datetime
and set its value to the variable Datetime
from the parent pipeline. Note: The parameters in the parent and child pipelines should have the same name to pass the values correctly.
Here is a sample code to pass the variable:
json
{
"name": "Execute Child Pipeline",
"type": "ExecutePipeline",
"parameters": {
"Datetime": "@variables('Datetime')"
},
"linkedServiceName": {
"referenceName": "ChildPipeline",
"type": "LinkedServiceReference"
}
}
In this code, @variables('Datetime')
is used to get the value of the Datetime
Variable from the parent pipeline and pass it to the child pipeline.