Registry / azure / azure-mgmt-storage

azure-mgmt-storage

JSON →
library25.1.0pypypi✓ verified 24d ago

The `azure-mgmt-storage` library is the Microsoft Azure Storage Management Client Library for Python, part of the Azure SDK. It enables programmatic management of Azure Storage resources, including creating, updating, and deleting storage accounts, blob containers, file shares, queues, and retrieving access keys. It focuses on the management plane operations for Azure Storage. The library is currently at version 24.0.1 and follows an active release cadence with regular updates and improvements.

pip install azure-mgmt-storage azure-identity
INSTALL
IMPORT
SIG · AZURE-MGMT-STORAGE
A
azure-mgmt-storage
azurepythonv25.1.0
Install
4.0s avg
Import
712ms
Disk
47MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v25.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.756s · 47.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.0s · import 0.668s · 48MB
47MB installed
● package 47MB
Code
Verified usage

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

StorageManagementClient
from azure.mgmt.storage import StorageManagementClient
from azure.mgmt.storage.storage_management_client import StorageManagementClient
As of version 24.0.0, importing from `azure.mgmt.storage.storage_management_client` no longer works. The client should be imported directly from `azure.mgmt.storage`.
DefaultAzureCredential
from azure.identity import DefaultAzureCredential

This quickstart demonstrates how to initialize the `StorageManagementClient` using `DefaultAzureCredential` for authentication and then list all storage accounts within your Azure subscription. Ensure you have the `AZURE_SUBSCRIPTION_ID` environment variable set, and authenticate via Azure CLI (`az login`) or by setting service principal environment variables (`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`).

import os from azure.identity import DefaultAzureCredential from azure.mgmt.storage import StorageManagementClient # Set environment variables for authentication and subscription # AZURE_SUBSCRIPTION_ID # AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET (for Service Principal) # Or use 'az login' for Azure CLI credential try: subscription_id = os.environ['AZURE_SUBSCRIPTION_ID'] except KeyError: print("Please set the AZURE_SUBSCRIPTION_ID environment variable.") exit(1) # Acquire a credential object credential = DefaultAzureCredential() # Initialize the Storage Management client storage_client = StorageManagementClient(credential, subscription_id) # List all storage accounts in the subscription print("Listing storage accounts...") for account in storage_client.storage_accounts.list(): print(f" Name: {account.name}, Location: {account.location}")
Debug
Known issues
breakingThe credential system was completely revamped. Old `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported. Users must migrate to `azure-identity` classes (e.g., `DefaultAzureCredential`). Additionally, the `credentials` parameter was renamed to `credential` in client constructors.
fix
Replace legacy credential imports and objects with classes from `azure.identity`. Update client constructor parameter from `credentials` to `credential`.
affects: v16.0.0b1 and later, including v24.0.1
breakingThe `StorageManagementClient` can no longer be imported from `azure.mgmt.storage.storage_management_client`. It must be imported directly from the top-level `azure.mgmt.storage` package.
fix
Change import statement from `from azure.mgmt.storage.storage_management_client import StorageManagementClient` to `from azure.mgmt.storage import StorageManagementClient`.
affects: v24.0.0 and later, including v24.0.1
breakingAs of v24.0.0, the package primarily targets only the *latest* API-Version available on Azure, removing APIs of other versions. If your application relies on a specific older (non-latest) API-Version, it is recommended to pin the `azure-mgmt-storage` package to a previous major version that supported that API.
fix
For applications requiring a specific, non-latest API version, explicitly pin the `azure-mgmt-storage` package to a previous version (e.g., `azure-mgmt-storage==21.2.1` for API version '2023-05-01') in your `requirements.txt` or `setup.py`.
affects: v24.0.0 and later, including v24.0.1
gotchaThis library (`azure-mgmt-storage`) is for *management plane* operations (e.g., creating storage accounts, managing keys, policies). For *data plane* operations (e.g., uploading blobs, reading files, sending queue messages), you need the specific data client libraries like `azure-storage-blob`, `azure-storage-file-share`, `azure-storage-queue`, etc.
fix
Ensure you are using the correct library for your task: `azure-mgmt-storage` for management and `azure-storage-*` libraries for data operations.
affects: All versions
gotchaUsers upgrading to the latest beta or even some generally available versions of the Azure Storage SDKs (including management libraries) might encounter `InvalidHeaderValue` error messages in rare scenarios. This could be due to internal SDK changes.
fix
If this issue occurs, downgrade to the previous generally available version of the SDK to see if it resolves. If the problem persists or downgrading is not feasible, open a support ticket with Microsoft.
affects: Potentially any recent beta or GA versions
gotchaNewer API versions, which the `azure-mgmt-storage` package now targets by default, might not be immediately available in all Azure regions, particularly in sovereign clouds like Azure China. This can lead to deployment failures if trying to use the latest API version in an unsupported region.
fix
Check the Azure documentation for API version availability in your target region. If the latest API is not supported, pin `azure-mgmt-storage` to an older package version that uses a supported API version for your region.
affects: v24.0.0 and later, specifically when targeting regions with delayed API support
gotchaThe `AZURE_SUBSCRIPTION_ID` environment variable is required by many Azure management SDKs to identify the target subscription for operations. If not set, operations may fail or prompt for this variable.
fix
Ensure the `AZURE_SUBSCRIPTION_ID` environment variable is set in your environment (e.g., `export AZURE_SUBSCRIPTION_ID="<your-subscription-id>"` on Linux/macOS or `$env:AZURE_SUBSCRIPTION_ID="<your-subscription-id>"` on PowerShell) before running your application.
affects: All versions
gotchaAzure management clients require the `AZURE_SUBSCRIPTION_ID` environment variable to be set to identify the target subscription for operations. Failure to set this variable will result in runtime errors.
fix
Ensure the `AZURE_SUBSCRIPTION_ID` environment variable is set in your environment with a valid Azure subscription ID before initializing and using Azure management clients.
affects: All versions
Upgrade
Version history
25.1.0latest on PyPI · released Jul 20, 2026
Audit
Dependencies
azure-identityrequiredRequired for authentication with Azure Active Directory and other credential types. Most examples and quickstarts use `DefaultAzureCredential` from this package.
Agent activity
50 hits · last 30 days
node
42
OpenAI (training)
1
Resources
azure-mgmt-storage — pip install azure-mgmt-storage · libregistry