Registry /
azure / azure-mgmt-containerregistry
Install & Compatibility
Where this runs
tested against v15.0.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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.632s · 45MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.9s · import 0.558s · 45MB
44MB installed
● package 44MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ContainerRegistryManagementClient
✓ from azure.mgmt.containerregistry import ContainerRegistryManagementClient
✗ from azure.mgmt.containerregistry.vXXXX_XX_XX import ContainerRegistryManagementClient
While API versions exist (e.g., v2021_08_01_preview), the top-level import generally points to the latest stable API version unless a specific older version is explicitly required. Pinning to a major version of the package is recommended over pinning to a specific API version in the import path. [12, 13]
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
Azure management libraries now standardize on `azure-identity` for credentials. [1]
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and then list all Azure Container Registries within a specified subscription. Ensure you have the necessary environment variables set for Azure authentication (e.g., `AZURE_SUBSCRIPTION_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`). [7, 14]
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerregistry import ContainerRegistryManagementClient
# Set your Azure Subscription ID as an environment variable (e.g., AZURE_SUBSCRIPTION_ID)
# Set other Azure Identity related environment variables (e.g., AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET)
# For more info: https://learn.microsoft.com/en-us/azure/developer/python/sdk/authentication-overview
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "your_subscription_id")
if subscription_id == "your_subscription_id":
print("Please set the AZURE_SUBSCRIPTION_ID environment variable.")
else:
# Authenticate using DefaultAzureCredential
# This credential will attempt to authenticate via environment variables, managed identity, Azure CLI, etc.
credential = DefaultAzureCredential()
# Create a ContainerRegistryManagementClient
client = ContainerRegistryManagementClient(credential, subscription_id)
# Example: List all container registries in the subscription
print(f"Listing container registries in subscription: {subscription_id}")
for registry in client.registries.list():
print(f" - {registry.name} (Location: {registry.location})")
Debug
Known issues
breakingBreaking change in 15.0.0: Some APIs related to container registry tasks have been moved to a new, more focused package: `azure-mgmt-containerregistrytasks`. If your application uses these APIs, you must migrate to the new package. [1, 2]fixRefer to the official migration guide for `azure-mgmt-containerregistry` (aka.ms/azsdk/python/migrate/azure-mgmt-containerregistry) and install `azure-mgmt-containerregistrytasks` if needed.
affects: >=15.0.0
breakingBreaking change in 15.0.0: The credential system has been completely revamped. Older authentication methods like `azure.common.credentials` or `msrestazure.azure_active_directory` are no longer supported. The `credentials` parameter for client initialization has been renamed to `credential`. [1]fixMigrate to `azure-identity` classes (e.g., `DefaultAzureCredential`) for authentication and update client constructor calls to use the `credential` parameter. See `https://pypi.org/project/azure-identity/` for details. [1]
affects: >=15.0.0
breakingBreaking change in 15.0.0 and subsequent versions: The package now exclusively targets the latest API-Version available on Azure, removing APIs from older versions to reduce package size. [1]fixIf your application relies on a specific, non-latest API-Version, it is recommended to pin the package to a previous major version of `azure-mgmt-containerregistry`. If you always use the latest API, no action is needed. [1]
affects: >=15.0.0
breakingBreaking change in 15.0.0: Introduction of new 'hybrid models' which possess both dictionary and model nature. This might impact how you access or manipulate model properties. [1, 2]fixConsult the migration guide for hybrid models (aka.ms/azsdk/python/migrate/hybrid-models) to understand the new model behavior and update your code accordingly. [1]
affects: >=15.0.0
breakingBreaking change in 15.0.0: Several model instance variables, such as `location` and `tags` on the `Resource` model, have been deleted or renamed. Other models like `ActiveDirectoryObject` and `ConnectedRegistryPropertiesActivation` might also have been removed or renamed. [2]fixReview your code for direct access to these properties or models and update them to use the new structure as per the release notes or migration guides. Pinning to a previous major version might be necessary if immediate migration is not feasible. [2]
affects: >=15.0.0
deprecatedOlder Azure SDK libraries that do not conform to current SDK guidelines are being deprecated. While they might still function, they will no longer receive official support and updates. [18]fixMicrosoft strongly recommends upgrading to the latest versions of Azure SDK libraries (like 15.0.0+) to benefit from ongoing security updates, performance improvements, and new features. [18]
affects: <15.0.0 (and generally older major versions)
gotchaThe `AZURE_SUBSCRIPTION_ID` environment variable is required for many operations, including client initialization or resource management, but was not found. The application cannot proceed without it.fixSet the `AZURE_SUBSCRIPTION_ID` environment variable in your environment or provide it programmatically to your Azure client constructors. Refer to Azure SDK authentication and configuration documentation for details on required environment variables and setup.
affects: All versions interacting with Azure resources
gotchaThe AZURE_SUBSCRIPTION_ID environment variable must be set for the library to interact with Azure resources. Failure to set this variable will prevent operations requiring a subscription ID.fixSet the AZURE_SUBSCRIPTION_ID environment variable to your valid Azure subscription ID before running applications that interact with Azure resources.
affects: All versions
Upgrade
Version history
15.0.0latest on PyPI · released Mar 19, 2026
Audit
Dependencies
PythonrequiredRequires Python 3.9 or later.
azure-identityrequiredRecommended for Azure Active Directory authentication.