Registry /
azure / azure-mgmt-datamigration
Install & Compatibility
Where this runs
tested against v10.1.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 0.722s · 46.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.1s · import 0.636s · 47MB
46MB installed
● package 46MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DataMigrationManagementClient
✓ from azure.mgmt.datamigration import DataMigrationManagementClient
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and list Data Migration Services within a specified resource group. Ensure you have the necessary environment variables (`AZURE_SUBSCRIPTION_ID`, `AZURE_RESOURCE_GROUP`) set for authentication and operation.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.datamigration import DataMigrationManagementClient
# Set your Azure Subscription ID as an environment variable or replace directly
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "<your-subscription-id>")
# Acquire a credential using DefaultAzureCredential. This will try various methods
# like environment variables (AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET),
# Azure CLI, Managed Identity, etc.
credential = DefaultAzureCredential()
# Create a DataMigrationManagementClient
client = DataMigrationManagementClient(credential, subscription_id)
# Example: List all Data Migration Services in a resource group
resource_group_name = os.environ.get("AZURE_RESOURCE_GROUP", "<your-resource-group>")
print(f"Listing Data Migration Services in resource group: {resource_group_name}")
try:
for service in client.services.list_by_resource_group(resource_group_name):
print(f" Service Name: {service.name}, Location: {service.location}")
except Exception as e:
print(f"An error occurred: {e}")
print("Please ensure AZURE_SUBSCRIPTION_ID and AZURE_RESOURCE_GROUP are set,")
print("and that your principal has 'Reader' permissions on the resource group.")
Debug
Known issues
breakingVersion 9.0.0b1 introduced significant breaking changes, revamping the authentication system. Old `azure.common.credentials` or `msrestazure.azure_active_directory` are no longer supported; use `azure-identity` classes instead. The `credentials` parameter was also renamed to `credential`.fixMigrate authentication to `azure-identity` library (e.g., `DefaultAzureCredential`). Update client instantiation to use `credential=DefaultAzureCredential()` and ensure `subscription_id` is passed. [2, 5, 7]
affects: >=9.0.0b1
breakingOlder versions (e.g., 3.0.0) introduced breaking changes related to module visibility and renaming. Direct imports from sub-modules like `data_migration_service_client` for `DataMigrationServiceManagementClient`, or `models.my_class`, `operations.my_class_operations` are no longer supported. Operation methods returning `msrest.polling.LROPoller` were changed to `azure.core.polling.LROPoller` and prefixed with `begin_`.fixAdjust import paths to `from azure.mgmt.datamigration import ...`. For long-running operations, use methods prefixed with `begin_` and expect `azure.core.polling.LROPoller`. [5]
affects: >=3.0.0, <9.0.0b1
gotcha`DefaultAzureCredential` relies on specific environment variables (e.g., `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`) or other configured authentication methods (Azure CLI, Managed Identity). Misconfiguration is a common source of `ClientAuthenticationError`.fixEnsure required environment variables are correctly set for service principal authentication, or that you are logged in via Azure CLI/configured for Managed Identity. Refer to `azure-identity` documentation for credential precedence. [2, 5, 7, 8, 11, 12]
affects: All
gotchaThe Azure Database Migration Service has operational limits, such as a maximum of four databases per migration activity. Attempting to migrate more than this limit in a single activity will result in a validation error.fixDivide large migrations into multiple activities, each handling four or fewer databases. If parallel migrations are needed for more databases, provision additional Azure Database Migration Service instances. [16]
affects: All
gotchaNetwork and DNS misconfigurations, including dynamic ports for SQL Server instances, incorrect ExpressRoute setup, or firewall rules, are frequent causes of connection failures during migration setup within the Data Migration Service.fixThoroughly review network configurations, firewall rules, and DNS settings. For SQL Server, ensure static ports are used or that the SQL Server Browser service (UDP port 1434) is reachable if dynamic ports/named instances are necessary. For ExpressRoute, confirm required service endpoints are provisioned. [14, 16]
affects: All
Upgrade
Version history
10.1.0latest on PyPI · released Sep 22, 2025
Audit
Dependencies
azure-identityrequiredRequired for modern Azure Active Directory-based authentication for Azure SDK clients.
azure-corerequiredCore utilities and exceptions for Azure SDKs.
msrestazurerequiredAzure-specific extensions for msrest client runtime.
msrestrequiredCore client runtime for AutoRest generated Python clients.