{"id":971,"library":"azure-mgmt-storage","title":"Azure Storage Management Client Library for Python","description":"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.","status":"active","version":"24.0.1","language":"python","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-mgmt-storage","tags":["azure","storage","management","cloud","sdk","microsoft","resource-management"],"install":[{"cmd":"pip install azure-mgmt-storage azure-identity","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Required for authentication with Azure Active Directory and other credential types. Most examples and quickstarts use `DefaultAzureCredential` from this package.","package":"azure-identity","optional":false}],"imports":[{"note":"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`.","wrong":"from azure.mgmt.storage.storage_management_client import StorageManagementClient","symbol":"StorageManagementClient","correct":"from azure.mgmt.storage import StorageManagementClient"},{"symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.storage import StorageManagementClient\n\n# Set environment variables for authentication and subscription\n# AZURE_SUBSCRIPTION_ID\n# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET (for Service Principal)\n# Or use 'az login' for Azure CLI credential\n\ntry:\n    subscription_id = os.environ['AZURE_SUBSCRIPTION_ID']\nexcept KeyError:\n    print(\"Please set the AZURE_SUBSCRIPTION_ID environment variable.\")\n    exit(1)\n\n# Acquire a credential object\ncredential = DefaultAzureCredential()\n\n# Initialize the Storage Management client\nstorage_client = StorageManagementClient(credential, subscription_id)\n\n# List all storage accounts in the subscription\nprint(\"Listing storage accounts...\")\nfor account in storage_client.storage_accounts.list():\n    print(f\"  Name: {account.name}, Location: {account.location}\")","lang":"python","description":"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`)."},"warnings":[{"fix":"Replace legacy credential imports and objects with classes from `azure.identity`. Update client constructor parameter from `credentials` to `credential`.","message":"The 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.","severity":"breaking","affected_versions":"v16.0.0b1 and later, including v24.0.1"},{"fix":"Change import statement from `from azure.mgmt.storage.storage_management_client import StorageManagementClient` to `from azure.mgmt.storage import StorageManagementClient`.","message":"The `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.","severity":"breaking","affected_versions":"v24.0.0 and later, including v24.0.1"},{"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`.","message":"As 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.","severity":"breaking","affected_versions":"v24.0.0 and later, including v24.0.1"},{"fix":"Ensure you are using the correct library for your task: `azure-mgmt-storage` for management and `azure-storage-*` libraries for data operations.","message":"This 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Users 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.","severity":"gotcha","affected_versions":"Potentially any recent beta or GA versions"},{"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.","message":"Newer 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.","severity":"gotcha","affected_versions":"v24.0.0 and later, specifically when targeting regions with delayed API support"},{"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.","message":"The `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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Azure 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T21:57:29.955Z","next_check":"2026-06-27T00:00:00.000Z","problems":[{"fix":"Ensure the package is correctly installed using pip: `pip install azure-mgmt-storage`","cause":"This error occurs when the `azure-mgmt-storage` package is not installed in your Python environment or is not accessible within the current Python path.","error":"ModuleNotFoundError: No module named 'azure.mgmt.storage'"},{"fix":"Verify the subscription ID is correct and you have the necessary permissions. Ensure your Azure CLI or environment variables (`AZURE_SUBSCRIPTION_ID`) are set to the correct subscription, or explicitly pass the correct `subscription_id` to the `StorageManagementClient` constructor after authenticating. You might need to log in to Azure CLI (`az login`) and set the active subscription (`az account set --subscription <your_subscription_id>`).","cause":"This error indicates that the provided subscription ID is either incorrect, you do not have access to it, or your current authentication context is not set to the correct Azure subscription.","error":"(SubscriptionNotFound) The subscription 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' could not be found."},{"fix":"Check for typos in the resource group name. Confirm the resource group exists in the Azure portal or via Azure CLI (`az group show --name my-resource-group --subscription <your_subscription_id>`). If it doesn't exist, create it before attempting to manage resources within it.","cause":"This error means that the specified Azure Resource Group does not exist in the selected subscription or is misspelled.","error":"(ResourceGroupNotFound) Resource group 'my-resource-group' could not be found."},{"fix":"Verify the storage account name and the resource group name are correct. Ensure the storage account exists and is accessible to the authenticated principal in the specified subscription. Check permissions (e.g., 'Storage Account Contributor' role).","cause":"This error occurs when the storage account with the given name does not exist in the specified resource group and subscription, or your identity lacks permission to view it.","error":"(StorageAccountNotFound) The storage account 'myuniquestorageaccount' was not found."},{"fix":"Update your code to pass all arguments to model constructors using keyword arguments (e.g., `Sku(name=\"Standard_RAGRS\")` instead of `Sku(\"Standard_RAGRS\")`). Consider upgrading `azure-mgmt-storage` to a newer version if you are on a very old one.","cause":"This typically occurs with older versions of `azure-mgmt-storage` (pre-2.x) when model classes (like `Sku`, `StorageAccountCreateParameters`) were updated to use keyword-only arguments instead of positional arguments, causing a mismatch if you're passing values positionally.","error":"TypeError: __init__() takes exactly 1 argument (2 given)"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":null,"quickstart_tag":null,"pypi_latest":"24.0.1","cli_name":"","install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.49,"mem_mb":12.1,"disk_size":"46.0M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.49,"mem_mb":12.1,"disk_size":"44.9M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":3.9,"import_time_s":0.35,"mem_mb":12.1,"disk_size":"46M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.33,"mem_mb":12.1,"disk_size":"45M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.67,"mem_mb":13.5,"disk_size":"50.0M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.73,"mem_mb":13.5,"disk_size":"48.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":3.8,"import_time_s":0.59,"mem_mb":13.5,"disk_size":"50M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.55,"mem_mb":13.5,"disk_size":"49M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.84,"mem_mb":13.5,"disk_size":"41.4M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.87,"mem_mb":13.5,"disk_size":"40.3M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":3.3,"import_time_s":0.78,"mem_mb":13.5,"disk_size":"42M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.79,"mem_mb":13.5,"disk_size":"41M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.83,"mem_mb":13.7,"disk_size":"41.1M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.84,"mem_mb":13.7,"disk_size":"39.8M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":3.4,"import_time_s":0.78,"mem_mb":13.7,"disk_size":"41M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.82,"mem_mb":13.7,"disk_size":"40M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.47,"mem_mb":11.8,"disk_size":"46.0M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.48,"mem_mb":11.8,"disk_size":"45.0M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":4.4,"import_time_s":0.45,"mem_mb":11.8,"disk_size":"46M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.46,"mem_mb":11.8,"disk_size":"45M"}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":null,"tag_description":null,"results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}