Azure Data Factory 및 Synapse Analytics에서 파이프라인 작업 실행

적용 대상: Azure Data Factory Azure Synapse Analytics

기업용 올인원 분석 솔루션인 Microsoft Fabric의 Data Factory를 사용해 보세요. Microsoft Fabric은 데이터 이동부터 데이터 과학, 실시간 분석, 비즈니스 인텔리전스 및 보고에 이르기까지 모든 것을 다룹니다. 무료로 새 평가판을 시작하는 방법을 알아봅니다!

Execute Pipeline 작업을 사용하면 Data Factory 또는 Synapse 파이프라인에서 다른 파이프라인을 호출할 수 있습니다.

UI를 사용하여 파이프라인 실행 작업 만들기

파이프라인에서 파이프라인 실행 작업을 사용하려면 다음 단계를 완료합니다.

  1. 파이프라인 작업 창에서 파이프라인을 검색하고 파이프라인 실행 작업을 파이프라인 캔버스로 끕니다.

  2. 아직 선택되지 않은 경우 캔버스에서 새 파이프라인 실행 작업과 해당 설정 탭을 선택하여 세부 정보를 편집합니다.

    Shows the UI for an execute pipeline activity.

  3. 기존 파이프라인을 선택하거나 새로 만들기 단추를 사용하여 새 파이프라인을 만듭니다. 구성을 완료하는 데 필요한 경우 다른 옵션을 선택하고 파이프라인에 대한 매개 변수를 구성합니다.

구문

{
    "name": "MyPipeline",
    "properties": {
        "activities": [
            {
                "name": "ExecutePipelineActivity",
                "type": "ExecutePipeline",
                "typeProperties": {
                    "parameters": {                        
                        "mySourceDatasetFolderPath": {
                            "value": "@pipeline().parameters.mySourceDatasetFolderPath",
                            "type": "Expression"
                        }
                    },
                    "pipeline": {
                        "referenceName": "<InvokedPipelineName>",
                        "type": "PipelineReference"
                    },
                    "waitOnCompletion": true
                 }
            }
        ],
        "parameters": [
            {
                "mySourceDatasetFolderPath": {
                    "type": "String"
                }
            }
        ]
    }
}

형식 속성

속성 설명 허용된 값 필수
name 파이프라인 실행 작업의 이름입니다. 문자열
type ExecutePipeline으로 설정되어야 합니다. 문자열
파이프라인 이 파이프라인을 호출하는 종속 파이프라인에 대한 파이프라인 참조입니다. 파이프라인 참조 개체에는 두 가지 속성(referenceNametype)이 있습니다. referenceName 속성은 참조 파이프라인의 이름을 지정합니다. type 속성은 PipelineReference로 설정되어야 합니다. PipelineReference
매개 변수 호출된 파이프라인으로 전달될 매개 변수 매개 변수 이름을 인수 값에 매핑하는 JSON 개체 아니요
waitOnCompletion 종속 파이프라인 실행이 완료될 때까지 작업 실행을 기다릴지 여부를 정의합니다. 기본값은 true입니다. 부울 아니요

예제

이 시나리오에는 두 개의 파이프라인이 있습니다.

  • 마스터 파이프라인 - 이 파이프라인에는 호출된 파이프라인을 호출하는 하나의 파이프라인 실행 작업이 있습니다. 마스터 파이프라인에는 두 개의 매개 변수, masterSourceBlobContainermasterSinkBlobContainer가 필요합니다.
  • 호출된 파이프라인 - 이 파이프라인에는 Azure Blob 원본에서 Azure Blob 싱크로 데이터를 복사하는 하나의 복사 작업이 있습니다. 호출된 파이프라인에는 두 개의 매개 변수, sourceBlobContainersinkBlobContainer가 필요합니다.

마스터 파이프라인 정의

{
  "name": "masterPipeline",
  "properties": {
    "activities": [
      {
        "type": "ExecutePipeline",
        "typeProperties": {
          "pipeline": {
            "referenceName": "invokedPipeline",
            "type": "PipelineReference"
          },
          "parameters": {
            "sourceBlobContainer": {
              "value": "@pipeline().parameters.masterSourceBlobContainer",
              "type": "Expression"
            },
            "sinkBlobContainer": {
              "value": "@pipeline().parameters.masterSinkBlobContainer",
              "type": "Expression"
            }
          },
          "waitOnCompletion": true
        },
        "name": "MyExecutePipelineActivity"
      }
    ],
    "parameters": {
      "masterSourceBlobContainer": {
        "type": "String"
      },
      "masterSinkBlobContainer": {
        "type": "String"
      }
    }
  }
}

호출된 파이프라인 정의

{
  "name": "invokedPipeline",
  "properties": {
    "activities": [
      {
        "type": "Copy",
        "typeProperties": {
          "source": {
            "type": "BlobSource"
          },
          "sink": {
            "type": "BlobSink"
          }
        },
        "name": "CopyBlobtoBlob",
        "inputs": [
          {
            "referenceName": "SourceBlobDataset",
            "type": "DatasetReference"
          }
        ],
        "outputs": [
          {
            "referenceName": "sinkBlobDataset",
            "type": "DatasetReference"
          }
        ]
      }
    ],
    "parameters": {
      "sourceBlobContainer": {
        "type": "String"
      },
      "sinkBlobContainer": {
        "type": "String"
      }
    }
  }
}

연결된 서비스

{
    "name": "BlobStorageLinkedService",
    "properties": {
    "type": "AzureStorage",
    "typeProperties": {
      "connectionString": "DefaultEndpointsProtocol=https;AccountName=*****;AccountKey=*****"
    }
  }
}

원본 데이터 세트

{
    "name": "SourceBlobDataset",
    "properties": {
    "type": "AzureBlob",
    "typeProperties": {
      "folderPath": {
        "value": "@pipeline().parameters.sourceBlobContainer",
        "type": "Expression"
      },
      "fileName": "salesforce.txt"
    },
    "linkedServiceName": {
      "referenceName": "BlobStorageLinkedService",
      "type": "LinkedServiceReference"
    }
  }
}

싱크 데이터 세트

{
    "name": "sinkBlobDataset",
    "properties": {
    "type": "AzureBlob",
    "typeProperties": {
      "folderPath": {
        "value": "@pipeline().parameters.sinkBlobContainer",
        "type": "Expression"
      }
    },
    "linkedServiceName": {
      "referenceName": "BlobStorageLinkedService",
      "type": "LinkedServiceReference"
    }
  }
}

파이프라인 실행

이 예제에서 마스터 파이프라인을 실행하려면 masterSourceBlobContainer 및 masterSinkBlobContainer 매개 변수에 다음 값이 전달됩니다.

{
  "masterSourceBlobContainer": "executetest",
  "masterSinkBlobContainer": "executesink"
}

다음 예제와 같이 마스터 파이프라인은 호출된 파이프라인에 이 값을 전달합니다.

{
    "type": "ExecutePipeline",
    "typeProperties": {
      "pipeline": {
        "referenceName": "invokedPipeline",
        "type": "PipelineReference"
      },
      "parameters": {
        "sourceBlobContainer": {
          "value": "@pipeline().parameters.masterSourceBlobContainer",
          "type": "Expression"
        },
        "sinkBlobContainer": {
          "value": "@pipeline().parameters.masterSinkBlobContainer",
          "type": "Expression"
        }
      },

      ....
}

Warning

Execute Pipeline 작업은 배열 매개 변수를 문자열로 자식 파이프라인에 전달합니다. 이는 페이로드가 부모 파이프라인에서 >자식으로 문자열로 전달되기 때문입니다. 자식 파이프라인에 전달된 입력을 검사할 때 확인할 수 있습니다. 자세한 내용은 이 섹션을 참조하세요.

지원되는 다른 제어 흐름 작업을 참조하세요.