Bearbeiten

Azure Data Factory-Bibliotheken für PythonAzure Data Factory libraries for Python

Kombinieren von Datenspeicherungs-, Verschiebungs- und Verarbeitungsdiensten in automatisierten Datenpipelines mit Azure Data FactoryCompose data storage, movement, and processing services into automated data pipelines with Azure Data Factory

Erfahren Sie mehr über Data Factory, und führen Sie mit der Schnellstartanleitung zum Erstellen einer Data Factory und Pipeline mithilfe von Python die ersten Schritte aus.Learn more about Data Factory and get started with the Create a data factory and pipeline using Python quickstart.

VerwaltungsmodulManagement module

Über das Verwaltungsmodul können Sie Data Factory-Instanzen in Ihrem Abonnement erstellen und verwalten.Create and manage Data Factory instances in your subscription with the management module.

InstallationInstallation

Installieren Sie das Paket mithilfe von pip.Install the package with pip:

pip install azure-mgmt-datafactory 

BeispielExample

Erstellen Sie eine Data Factory-Instanz in Ihrem Abonnement in der Region „USA, Osten“.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)