다음을 통해 공유


매핑 데이터 흐름의 외부 호출 변환

적용 대상: Azure Data Factory Azure Synapse Analytics

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

데이터 흐름은 Azure Data Factory 및 Azure Synapse Pipelines 모두에서 사용할 수 있습니다. 이 문서는 매핑 데이터 흐름에 적용됩니다. 변환을 처음 사용하는 경우 매핑 데이터 흐름을 사용하여 데이터 변환 소개 문서를 참조하세요.

외부 호출 변환을 사용하면 데이터 엔지니어가 사용자 지정 또는 타사 결과를 데이터 흐름 스트림에 추가하기 위해 외부 REST 엔드포인트를 행별로 호출할 수 있습니다.

구성

외부 호출 변환 구성 패널에서 먼저 연결하려는 외부 엔드포인트의 유형을 선택합니다. 다음 단계는 들어오는 열을 매핑하는 것입니다. 마지막으로 다운스트림 변환에서 사용할 출력 데이터 구조를 정의합니다.

External call

설정

인라인 데이터 세트 형식 및 연결된 서비스를 선택합니다. 현재 REST만 지원됩니다. 그러나 SQL 저장 프로시저 및 기타 연결된 서비스 유형도 사용할 수 있게 됩니다. 설정 속성에 대한 설명은 REST 원본 구성을 참조하세요.

매핑

자동 매핑을 선택하여 모든 입력 열을 엔드포인트에 전달할 수 있습니다. 필요에 따라 수동으로 열을 설정하고 여기에서 대상 엔드포인트로 전송되는 열의 이름을 바꿀 수 있습니다.

출력

여기서 외부 호출의 출력에 대한 데이터 구조를 정의합니다. 본문의 구조를 정의하고 외부 호출에서 반환된 헤더 및 상태를 저장하는 방법을 선택할 수 있습니다.

본문, 헤더 및 상태를 저장하도록 선택한 경우 먼저 다운스트림 데이터 변환에서 사용할 수 있도록 각각에 대한 열 이름을 선택합니다.

ADF 데이터 흐름 구문을 사용하여 본문 데이터 구조를 수동으로 정의할 수 있습니다. 본문에 대한 열 이름 및 데이터 형식을 정의하려면 "프로젝션 가져오기"를 클릭하고 ADF가 외부 호출에서 스키마 출력을 검색하도록 허용합니다. 다음은 날씨 REST API GET 호출의 출력인 스키마 정의 구조 예제입니다.

({@context} as string[],
		geometry as (coordinates as string[][][],
		type as string),
		properties as (elevation as (unitCode as string,
		value as string),
		forecastGenerator as string,
		generatedAt as string,
		periods as (detailedForecast as string, endTime as string, icon as string, isDaytime as string, name as string, number as string, shortForecast as string, startTime as string, temperature as string, temperatureTrend as string, temperatureUnit as string, windDirection as string, windSpeed as string)[],
		units as string,
		updateTime as string,
		updated as string,
		validTimes as string),
		type as string)

예제

데이터 흐름 스크립트를 포함한 샘플

External call sample

source(output(
		id as string
	),
	allowSchemaDrift: true,
	validateSchema: false,
	ignoreNoFilesFound: false) ~> source1
Filter1 call(mapColumn(
		id
	),
	skipDuplicateMapInputs: false,
	skipDuplicateMapOutputs: false,
	output(
		headers as [string,string],
		body as (name as string)
	),
	allowSchemaDrift: true,
	store: 'restservice',
	format: 'rest',
	timeout: 30,
	httpMethod: 'POST',
	entity: 'api/Todo/',
	requestFormat: ['type' -> 'json'],
	responseFormat: ['type' -> 'json', 'documentForm' -> 'documentPerLine']) ~> ExternalCall1
source1 filter(toInteger(id)==1) ~> Filter1
ExternalCall1 sink(allowSchemaDrift: true,
	validateSchema: false,
	skipDuplicateMapInputs: true,
	skipDuplicateMapOutputs: true,
	store: 'cache',
	format: 'inline',
	output: false,
	saveOrder: 1) ~> sink1

데이터 흐름 스크립트

ExternalCall1 sink(allowSchemaDrift: true,
	validateSchema: false,
	skipDuplicateMapInputs: true,
	skipDuplicateMapOutputs: true,
	store: 'cache',
	format: 'inline',
	output: false,
	saveOrder: 1) ~> sink1