Registry / azure / azure-mgmt-datamigration

azure-mgmt-datamigration

JSON →
library10.1.0pypypi✓ verified 25d ago

The `azure-mgmt-datamigration` library provides client-side functionality for interacting with the Azure Data Migration Service, allowing programmatic management of data migration tasks to Azure data platforms. It is part of the Azure SDK for Python, currently at version 10.1.0, and follows the modern Azure SDK guidelines, with regular updates and releases.

pip install azure-mgmt-datamigration azure-identity
INSTALL
IMPORT
SIG · AZURE-MGMT-DATAMIG
A
azure-mgmt-datamigration
azurepythonv10.1.0
Install
4.1s avg
Import
679ms
Disk
46MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.722s · 46.8MB
glibc
py 3.103.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`.
fix
Migrate 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_`.
fix
Adjust 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`.
fix
Ensure 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.
fix
Divide 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.
fix
Thoroughly 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.
Agent activity
35 hits · last 30 days
node
28
Amazon
1
OpenAI (training)
1
Resources
azure-mgmt-datamigration — pip install azure-mgmt-datamigration · libregistry