{"id":1390,"library":"azure-storage-common","title":"Azure Storage Common Client Library (Track 1 SDK)","description":"The `azure-storage-common` library provides common functionalities and utilities shared across the older Microsoft Azure Storage 'Track 1' client libraries for Python (e.g., `azure-storage-blob` v2.x, `azure-storage-queue` v2.x). It includes classes for managing storage accounts, shared access signatures, and handling exceptions. The current version is 2.1.0, with releases historically tied to new Azure Storage REST API versions, though it is now largely in maintenance mode.","status":"maintenance","version":"2.1.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-storage-python","tags":["azure","storage","common","track1-sdk","v2-sdk","deprecated-sdk"],"install":[{"cmd":"pip install azure-storage-common","lang":"bash","label":"Install `azure-storage-common`"}],"dependencies":[{"reason":"Provides core Azure client library utilities.","package":"azure-common","optional":false}],"imports":[{"note":"CloudStorageAccount is a common utility for Track 1 SDKs; it resides in azure.storage.common, not individual service clients.","wrong":"from azure.storage.blob import CloudStorageAccount","symbol":"CloudStorageAccount","correct":"from azure.storage.common import CloudStorageAccount"}],"quickstart":{"code":"import os\nfrom azure.storage.common import CloudStorageAccount\n\n# Retrieve the connection string from an environment variable.\n# Example: AZURE_STORAGE_CONNECTION_STRING=\"DefaultEndpointsProtocol=https;AccountName=youraccount;AccountKey=yourkey;EndpointSuffix=core.windows.net\"\nconnection_string = os.environ.get(\"AZURE_STORAGE_CONNECTION_STRING\", \"\")\n\nif not connection_string:\n    print(\"Please set the AZURE_STORAGE_CONNECTION_STRING environment variable.\")\nelse:\n    try:\n        # Create a CloudStorageAccount object from the connection string\n        # This object is then used to create specific service clients (e.g., blob, queue, file).\n        account = CloudStorageAccount.create_from_connection_string(connection_string)\n\n        print(f\"Successfully created CloudStorageAccount for: {account.account_name}\")\n        print(\"This library provides common utilities for the Azure Storage Track 1 SDK (v2.x).\")\n        print(\"To perform storage operations, you would typically use this 'account' object\")\n        print(\"to instantiate a service client from another Track 1 library (e.g., azure-storage-blob v2.x).\")\n\n        # Example of how you would use it with azure-storage-blob v2.x (if installed):\n        # from azure.storage.blob import BlockBlobService\n        # block_blob_service = account.create_block_blob_service()\n        # print(f\"BlockBlobService created successfully using account: {block_blob_service.account_name}\")\n\n    except ValueError as e:\n        print(f\"Error creating storage account: {e}\")\n        print(\"Please ensure the AZURE_STORAGE_CONNECTION_STRING format is correct.\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize a `CloudStorageAccount` using a connection string. This object is the entry point for interacting with Azure Storage services when using the older Track 1 SDKs (v2.x of `azure-storage-blob`, `azure-storage-queue`, etc.). Ensure your Azure Storage connection string is set in the `AZURE_STORAGE_CONNECTION_STRING` environment variable."},"warnings":[{"fix":"For new projects or migrations, use the Track 2 SDK (e.g., `pip install azure-storage-blob` for v12.x+). Avoid mixing Track 1 and Track 2 in the same application.","message":"This library (`azure-storage-common` v2.x) is part of the older 'Track 1' Azure SDK for Python. The newer, recommended 'Track 2' SDK (e.g., `azure-storage-blob` v12.x+, `azure-storage-queue` v12.x+) does NOT use `azure-storage-common`. Migrating from Track 1 to Track 2 requires substantial code changes and a complete re-import strategy.","severity":"breaking","affected_versions":"All v2.x of `azure-storage-common` and its dependent Track 1 libraries."},{"fix":"Plan migration to the Track 2 SDKs (e.g., `azure-storage-blob` v12.x, `azure-storage-queue` v12.x, etc.) for future-proofing and access to new features.","message":"`azure-storage-common` is in maintenance mode for the Track 1 SDK. No new features are being added; only critical bug fixes are provided. For new development, it is highly recommended to use the Track 2 SDKs for Azure Storage.","severity":"deprecated","affected_versions":"All v2.x."},{"fix":"Standardize on either the Track 1 or Track 2 SDK across your application. Prioritize Track 2 for new development.","message":"Mixing Track 1 (`azure-storage-common` and its dependent v2.x libraries) with Track 2 (e.g., `azure-storage-blob` v12.x+) within the same application is highly discouraged and can lead to dependency conflicts, unexpected behavior, and increased bundle size.","severity":"gotcha","affected_versions":"All versions."},{"fix":"Ensure the connection string exactly matches the format provided by the Azure portal or documented examples. Keys are case-sensitive.","message":"The connection string format expected by `CloudStorageAccount.create_from_connection_string` is specific, requiring keys like `AccountName`, `AccountKey`, `DefaultEndpointsProtocol`, and `EndpointSuffix`. Incorrectly formatted strings will raise a `ValueError`.","severity":"gotcha","affected_versions":"All v2.x."}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}