Modifier

Bibliothèques Azure Data Factory pour PythonAzure Data Factory libraries for Python

Composition de services de stockage, de déplacement et de traitement des services au sein de pipelines de données automatisés avec Azure Data FactoryCompose data storage, movement, and processing services into automated data pipelines with Azure Data Factory

En savoir plus sur Data Factory et la prise en main en consultant Créer une fabrique de données et un pipeline à l’aide du démarrage rapide de Python.Learn more about Data Factory and get started with the Create a data factory and pipeline using Python quickstart.

Module de gestionManagement module

Créez et gérez des instances Data Factory dans votre abonnement avec le module de gestion.Create and manage Data Factory instances in your subscription with the management module.

InstallationInstallation

Installez le package avec pip :Install the package with pip:

pip install azure-mgmt-datafactory 

ExemplesExample

Créer une fabrique de données dans votre abonnement sur la région Est des États-Unis.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)