Install & Compatibility
Where this runs
tested against v10.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.498s · 53.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.3s · import 1.372s · 54MB
53MB installed
● package 53MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DataFactoryManagementClient
✓ from azure.mgmt.datafactory import DataFactoryManagementClient
✗ from azure.mgmt.datafactory.data_factory_management_client import DataFactoryManagementClient
The top-level package import is the standard and recommended way for Azure SDKs since version 2.x, avoiding deep package paths.
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
This quickstart demonstrates how to authenticate using `DefaultAzureCredential` and initialize the `DataFactoryManagementClient`. It then performs a basic operation to list Data Factories within a specified resource group. Ensure `AZURE_SUBSCRIPTION_ID` and `AZURE_RESOURCE_GROUP` are set in your environment variables for successful execution.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.datafactory import DataFactoryManagementClient
# --- Authentication ---
# Set environment variables for authentication:
# AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID (for Service Principal)
# or log in via Azure CLI: az login
# or use managed identity, etc.
# Retrieve subscription ID from environment variable
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "")
if not subscription_id:
print("Please set the AZURE_SUBSCRIPTION_ID environment variable.")
exit(1)
# Create a credential object using DefaultAzureCredential
# This attempts to authenticate via various methods (environment variables, managed identity, Azure CLI, etc.)
credential = DefaultAzureCredential()
# Create a DataFactoryManagementClient
data_factory_client = DataFactoryManagementClient(credential, subscription_id)
# --- Example Operation: List Data Factories in a Resource Group ---
resource_group_name = os.environ.get("AZURE_RESOURCE_GROUP", "") # Replace with your resource group or set env var
if not resource_group_name:
print("Please set the AZURE_RESOURCE_GROUP environment variable or provide a default.")
exit(1)
print(f"Listing data factories in resource group '{resource_group_name}':")
try:
factories = data_factory_client.factories.list_by_resource_group(resource_group_name)
found_factories = False
for factory in factories:
print(f"- Factory Name: {factory.name}, Location: {factory.location}")
found_factories = True
if not found_factories:
print("No data factories found in this resource group.")
except Exception as e:
print(f"Error listing data factories: {e}")
print("Make sure the resource group exists and your credential has 'Contributor' or 'Data Factory Contributor' role.")
print("Quickstart complete.")
Debug
Known issues
breakingMajor breaking changes occurred between versions 8.x and 9.x. The client constructor signatures changed, authentication now primarily uses `azure.identity` credentials, and `msrestazure` specific patterns are largely replaced. Migration to `azure.identity.DefaultAzureCredential` is mandatory.fixRewrite client instantiation to `DataFactoryManagementClient(credential, subscription_id)` and use `from azure.identity import DefaultAzureCredential` for authentication. Refer to Azure SDK migration guides for full details.
affects: 8.x and earlier upgrading to 9.x+
breakingVersion 9.0.0 and above of `azure-mgmt-datafactory` require Python 3.9 or higher. Installations on older Python versions will fail due to `Requires-Python` metadata.fixUpgrade your Python environment to 3.9 or newer before installing or running `azure-mgmt-datafactory` version 9 or higher.
affects: 9.0.0+
gotchaAuthentication issues are common. `DefaultAzureCredential` attempts various authentication methods (environment variables, managed identity, Azure CLI, etc.). Incorrect setup will lead to `CredentialUnavailableError` or permission errors.fixEnsure relevant environment variables (`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`) are set for service principals, or you are logged in via `az login` for user authentication, or other supported authentication methods are correctly configured for your environment.
affects: All versions using `azure.identity`
gotchaMany management operations require the Azure Resource Group name and other resource-specific names (e.g., factory name, pipeline name) as direct parameters. Forgetting or mistyping these can lead to `ResourceNotFound` or `404` errors, even with correct authentication.fixAlways double-check that required resource group names and other resource identifiers are correctly provided to the client methods. Use `os.environ.get()` to load them reliably for robust scripts.
affects: All versions
Upgrade
Version history
10.0.0latest on PyPI · released Jul 8, 2026
Audit
Dependencies
No dependency data recorded yet.