Registry / azure / azure-mgmt

azure-mgmt

JSON →
library5.0.0pypypi✓ verified 23d ago

The `azure-mgmt` package is a meta-package providing Microsoft Azure Resource Management Client Libraries for Python. It aggregates all individual `azure-mgmt-xxx` packages, allowing Python applications to programmatically manage Azure resources like virtual machines, storage accounts, and networks. The current version is 5.0.0, following the 'Track 2' design guidelines for the Azure SDK. It typically follows a continuous release cadence with updates to individual service clients.

pip install azure-mgmt azure-identity
INSTALL
IMPORT
SIG · AZURE-MGMT
A
azure-mgmt
azurepythonv5.0.0
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · 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
glibc
py 3.10
1/2 runs
1/2 runs
py 3.11
1/2 runs
1/2 runs
py 3.12
1/2 runs
1/2 runs
py 3.13
1/2 runs
1/2 runs
py 3.9
1/2 runs
1/2 runs
Code
Verified usage

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

ResourceManagementClient
from azure.mgmt.resource import ResourceManagementClient
from azure.mgmt import ResourceManagementClient
The `azure-mgmt` package is a meta-package. Client classes are found in specific sub-packages (e.g., `azure.mgmt.resource`, `azure.mgmt.compute`), not directly under `azure.mgmt`.
DefaultAzureCredential
from azure.identity import DefaultAzureCredential
Authentication classes are provided by the separate `azure-identity` package, which must be installed alongside `azure-mgmt` or its sub-packages.

This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and list all resource groups within a specified subscription. It requires the `AZURE_SUBSCRIPTION_ID` environment variable to be set and the `azure-identity` package installed. The `ResourceManagementClient` is imported from `azure.mgmt.resource`, which is part of the `azure-mgmt` meta-package.

import os from azure.identity import DefaultAzureCredential from azure.mgmt.resource import ResourceManagementClient # Set your Azure Subscription ID as an environment variable # E.g., export AZURE_SUBSCRIPTION_ID='YOUR_SUBSCRIPTION_ID' subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', '') if not subscription_id: print("Please set the AZURE_SUBSCRIPTION_ID environment variable.") else: try: # Authenticate using DefaultAzureCredential (looks for env vars, managed identity, etc.) credential = DefaultAzureCredential() # Create a ResourceManagementClient resource_client = ResourceManagementClient(credential, subscription_id) print(f"Listing resource groups in subscription: {subscription_id}") for rg in resource_client.resource_groups.list(): print(f"- {rg.name} ({rg.location})") except Exception as e: print(f"An error occurred: {e}") print("Ensure you have authenticated (e.g., `az login` or appropriate environment variables).")
Debug
Known issues
breakingMajor API redesign between 'Track 1' (older) and 'Track 2' (current) versions. `azure-mgmt` versions 5.0.0 and later are 'Track 2' which includes unified authentication, asynchronous support, and consistent client construction. Code written for older `azure-mgmt` versions (pre-5.0.0) will not be compatible.
fix
Refer to the Azure SDK for Python migration guide for detailed steps on updating client instantiation, authentication, and operation calls. This often involves changes in imports (e.g., `azure.mgmt.resource` instead of `azure.mgmt.resource.resources`), credential handling (using `azure-identity`), and method signatures.
affects: < 5.0.0 vs >= 5.0.0
gotchaThe `azure-mgmt` package is a meta-package that installs *all* individual `azure-mgmt-xxx` packages (e.g., `azure-mgmt-resource`, `azure-mgmt-compute`). While convenient, this can lead to a large number of dependencies. For production applications, it is often more efficient to install only the specific `azure-mgmt-SERVICE_NAME` packages required.
fix
Instead of `pip install azure-mgmt`, install specific packages like `pip install azure-mgmt-resource azure-mgmt-compute azure-identity` to reduce the dependency footprint and potential for conflicts.
affects: All versions of `azure-mgmt`.
gotchaAuthentication is handled by the separate `azure-identity` library. `azure-mgmt` client libraries do not include authentication mechanisms directly. Attempting to use clients without an `azure-identity` credential object will result in authentication errors.
fix
Always install `azure-identity` (`pip install azure-identity`) and pass a credential object (e.g., `DefaultAzureCredential()`) to the client constructor.
affects: All versions of `azure-mgmt`.
Upgrade
Version history
5.0.0latest on PyPI · released Apr 8, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources
azure-mgmt — pip install azure-mgmt · libregistry