简体   繁体   English

将值从父管道传递到Azure数据工厂中的子管道

[英]Passing values from parent pipeline to child pipeline in Azure Data Factory

I'm pretty sure this is simple, but I can't seem to find this anywhere. 我敢肯定这很简单,但是我似乎在任何地方都找不到。 I created a parameter in a parent pipeline (say the pipeline name is TestParent) in data factory: 我在数据工厂的父管道(例如管道名称为TestParent)中创建了一个参数:

在此处输入图片说明 This parent pipeline invokes a child pipeline. 该父管道调用子管道。 I want to reference this parameter in the child pipeline. 我想在子管道中引用此参数。 What is the syntax to get the value of this parameter from the parent in the child? 从子级的父级获取此参数的值的语法是什么?

OK I finally got this to work: 好了,我终于有了这个工作:

I completely removed the parameter from the parent pipeline. 我从父管道中完全删除了该参数。 In the child pipeline (which is called HubMaster) we create a parameter called MasterBatchId: 在子管道(称为HubMaster)中,我们创建一个称为MasterBatchId的参数:

在此处输入图片说明

In the parent pipeline I created an Execute pipeline node called EP_HubMaster that calls a child pipeline called HubMaster. 在父管道中,我创建了一个名为EP_HubMaster的执行管道节点,该节点调用了一个称为HubMaster的子管道。 In order to populate the child pipeline parameter MasterBatchId at run time, we need to edit the JSON of the parent pipeline to look like this: 为了在运行时填充子管道参数MasterBatchId,我们需要编辑父管道的JSON,如下所示:

{
"name": "TestParent",
"properties": {
    "activities": [
        {
            "name": "EP_HubMaster",
            "type": "ExecutePipeline",
            "typeProperties": {
                "pipeline": {
                    "referenceName": "HubMaster",
                    "type": "PipelineReference"
                },
                "parameters": {
                    "MasterBatchId": {
                        "value": "@pipeline().RunId",
                        "type": "Expression"
                    }
                }
            }
        }
    ],
    "folder": {
        "name": "Master"
    }
},
"type": "Microsoft.DataFactory/factories/pipelines"
}

You can see that we pass the @pipeline().RunId from the parent (which was the original intent) to the input parameter of MasterBatchId in the child pipeline. 您可以看到我们将@pipeline().RunId从父级(原始意图)传递给子级管道中MasterBatchId的输入参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM