Monday
In ADF, a variable called Datetime was specified to be entered and executed in a workflow called Parent using Web Activity.
There is a Child Workflow (two-step workflow) in Parent Workflow, and Datetime variables are available in Parent Workflow, but Datetime variables are not available in Child Workflow.
In my opinion, I expected the variable to be inherited from Parent to Child, but it was not. How can I apply it to Child Workflow the same as Parent?
Wednesday
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:
Datetime
.
2. Pass the variable values from the parent pipeline:
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.
Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections.
Click here to register and join today!
Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.