Registry / devops / azure-mgmt-dataprotection

azure-mgmt-dataprotection

JSON →
library2.0.1pypypi✓ verified 84d ago

Microsoft Azure Dataprotection Management Client Library for Python (version 2.0.1) enables management of Azure Backup and Azure Data Protection services, including backup policies, backup instances, and vaults. It follows a monthly release cadence and requires Python >=3.9.

pip install azure-mgmt-dataprotection
INSTALL
IMPORT
SIG · AZURE-MGMT-DATAPRO
A
azure-mgmt-dataprotection
devopspythonv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DataProtectionMgmtClient
from azure.mgmt.dataprotection import DataProtectionMgmtClient
from azure.mgmt.dataprotection import DataProtectionClient
The client class name is DataProtectionMgmtClient, not DataProtectionClient.

Initialize the client and list backup vaults in a resource group.

from azure.identity import DefaultAzureCredential from azure.mgmt.dataprotection import DataProtectionMgmtClient subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', '') credential = DefaultAzureCredential() client = DataProtectionMgmtClient(credential, subscription_id) # List backup vaults vaults = client.backup_vaults.list_by_resource_group(resource_group_name='myResourceGroup') for vault in vaults: print(vault.name)
Debug
Known issues
breakingVersion 2.0.0 introduced breaking changes: resource model classes were flattened, and operation groups like BackupVaultsOperations were renamed. Check migration guide before upgrading from 1.x.
fix
Review the changelog at https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/dataprotection/azure-mgmt-dataprotection/CHANGELOG.md
affects: 1.x -> 2.0.0+
deprecatedThe method 'delete' on backup instances now requires the 'x-ms-authorization-auxiliary' header for cross-tenant scenarios. Future releases may remove the overload without it.
fix
Pass the auxiliary token header using a HttpRequest pipeline policy or use the 'azure-common' client option.
affects: >=2.0.0
gotchaThe API version used by the client is hardcoded to a specific date (e.g., 2023-01-01). Manual override is not supported; you must ensure the server supports this version.
fix
Check the API version in the client source code; if incompatibility occurs, use a different SDK version that targets appropriate API version.
affects: all
gotchaThe `BackupVaultsOperations.get` method returns a `BackupVaultResource` object, not a dict. Accessing properties incorrectly (e.g., vault['name']) will raise TypeError.
fix
Use attribute access e.g., vault.name, vault.location, etc.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'DataProtectionMgmtClient' from 'azure.mgmt.dataprotection' (unknown location)
The package is not installed or the import path is incorrect.
fix
Install the package: pip install azure-mgmt-dataprotection, then use from azure.mgmt.dataprotection import DataProtectionMgmtClient
AttributeError: 'NoneType' object has no attribute 'name'
A resource (e.g., backup vault) does not exist or the resource group name is incorrect, resulting in None.
fix
Verify the resource group name and the presence of the resource. Check subscription ID and credentials.
azure.core.exceptions.HttpResponseError: (MissingSubscription) The request did not have a subscription or a valid tenant level resource provider.
The subscription ID is missing or invalid in the client initialization.
fix
Ensure subscription_id is provided and correct. Set AZURE_SUBSCRIPTION_ID environment variable or pass it directly.
Upgrade
Version history
2.0.1latest on PyPI · released Oct 9, 2025
Audit
Dependencies
azure-identityrequiredRequired for authentication with DefaultAzureCredential or other credential types.
azure-corerequiredProvides core HTTP pipeline and exception handling.
Agent activity
4 hits · last 30 days
node
4
Resources

No resource links recorded.

azure-mgmt-dataprotection — pip install azure-mgmt-dataprotection · libregistry