Microsoft Azure Data Box Edge Management Client Library for Python
This package provides the Microsoft Azure Data Box Edge Management Client Library for Python, enabling users to programmatically manage Azure Data Box Edge resources. It supports Python 3.8+ and is part of the actively maintained Azure SDK for Python.
Warnings
- breaking The credential system has been completely revamped in version 2.0.0. `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported. The `credentials` parameter has been renamed to `credential`.
- breaking Operations that previously returned `msrest.polling.LROPoller` now return `azure.core.polling.LROPoller` and are prefixed with `begin_`. The exception hierarchy has also been simplified; `CloudError` has been removed and most exceptions are now `azure.core.exceptions.HttpResponseError`.
- breaking Version 2.0.0 removed subfolders of some unused API versions to reduce package size. If your application relies on a specific, non-latest API version that was removed, it may break.
- gotcha For `DefaultAzureCredential` to work out-of-the-box, several environment variables are typically required for Azure Active Directory authentication (e.g., service principal details).
- gotcha The package requires Python 3.8 or newer. Using older Python versions will result in installation or runtime errors.
Install
-
pip install azure-mgmt-databoxedge azure-identity
Imports
- DataBoxEdgeManagementClient
from azure.mgmt.databoxedge import DataBoxEdgeManagementClient
- DefaultAzureCredential
from azure.identity import DefaultAzureCredential
Quickstart
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.databoxedge import DataBoxEdgeManagementClient
# Set environment variables for authentication:
# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID
subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', '')
if not subscription_id:
raise ValueError("AZURE_SUBSCRIPTION_ID environment variable is not set.")
# Authenticate using DefaultAzureCredential
credential = DefaultAzureCredential()
# Create a client
client = DataBoxEdgeManagementClient(credential, subscription_id)
# Example: List Data Box Edge devices (this is a placeholder for actual operations)
# Replace with actual resource group and device names as needed.
# print(client.devices.list_by_subscription())
print("Azure Data Box Edge client initialized. You can now perform operations.")