Python용 Azure Data Factory 라이브러리Azure Data Factory libraries for Python

Azure Data Factory로 데이터 저장, 이동 및 처리 서비스를 자동화된 데이터 파이프라인으로 만들어 보세요.Compose data storage, movement, and processing services into automated data pipelines with Azure Data Factory

Data Factory에 대해 자세히 알아보고 Python 퀵스타트를 사용하여 데이터 팩터리 및 파이프라인 만들기를 시작합니다.Learn more about Data Factory and get started with the Create a data factory and pipeline using Python quickstart.

관리 모듈Management module

관리 모듈을 사용하여 구독의 Data Factory 인스턴스를 만들고 관리합니다.Create and manage Data Factory instances in your subscription with the management module.

설치Installation

pip를 사용하여 패키지 설치합니다.Install the package with pip:

pip install azure-mgmt-datafactory 

Example

미국 동부 지역의 귀하의 구독 내에 Data Factory를 만듭니다.Create a Data Factory in your subscription on the East US region.

from azure.common.credentials import ServicePrincipalCredentials
from azure.mgmt.resource import ResourceManagementClient
from azure.mgmt.datafactory import DataFactoryManagementClient
from azure.mgmt.datafactory.models import *
import time

#Create a data factory
subscription_id = '<Specify your Azure Subscription ID>'
credentials = ServicePrincipalCredentials(client_id='<Active Directory application/client ID>', secret='<client secret>', tenant='<Active Directory tenant ID>')
adf_client = DataFactoryManagementClient(credentials, subscription_id)

rg_params = {'location':'eastus'}
df_params = {'location':'eastus'}  

df_resource = Factory(location='eastus')
df = adf_client.factories.create_or_update(rg_name, df_name, df_resource)
print_item(df)
while df.provisioning_state != 'Succeeded':
    df = adf_client.factories.get(rg_name, df_name)
    time.sleep(1)