Registry /
azure / azure-mgmt-managementgroups
Install & Compatibility
Where this runs
tested against v2.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.078s · 43.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.8s · import 0.082s · 44MB
43MB installed
● package 43MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ManagementGroupsAPI
✓ from azure.mgmt.managementgroups import ManagementGroupsAPI
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
Standard way to authenticate in Azure SDK for Python
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and list all existing Management Groups. This client operates at the tenant level, so it typically does not require a subscription ID.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.managementgroups import ManagementGroupsAPI
# This client is for managing Management Groups, which exist above subscriptions.
# No subscription ID is typically needed for client instantiation.
# Authenticate using DefaultAzureCredential. It will try various methods
# like environment variables, managed identity, Azure CLI, Visual Studio Code.
credential = DefaultAzureCredential()
# Create a ManagementGroupsAPI client
client = ManagementGroupsAPI(credential)
print('Listing all Management Groups:')
for mg in client.management_groups.list():
print(f'- ID: {mg.id}, Name: {mg.name}, Display Name: {mg.display_name}')
Debug
Known issues
gotchaAuthentication for Azure management clients primarily uses `azure-identity` and `DefaultAzureCredential`. Direct use of connection strings or SAS tokens is not applicable for ARM (Azure Resource Manager) operations, unlike some Azure data plane services (e.g., Storage Blobs).fixEnsure `azure-identity` is installed (`pip install azure-identity`) and use `DefaultAzureCredential` or other credential types from `azure.identity` for client authentication.
affects: All versions
gotchaList operations (e.g., `client.management_groups.list()`) return a paginated iterable. To access all results, you must iterate through the returned object. It does not return a simple list directly.fixAlways iterate over the results of `list()` methods, or convert them to a list explicitly if all items are needed at once: `list(client.management_groups.list())`.
affects: All versions
breakingOlder Azure SDK versions (pre-v2020) used different client construction and authentication patterns, often requiring explicit `ServiceClientCredentials` and a subscription ID passed to the client constructor, even for tenant-level operations. The current library (`1.x`) uses `azure-core` and `azure-identity` for a unified experience.fixUpgrade to the latest `azure-mgmt-managementgroups` library. Follow the modern quickstart patterns using `DefaultAzureCredential` and pass only the credential to the client constructor. For management groups, a subscription ID is generally not required for the client constructor.
affects: <1.0.0 (historical), transitioning from older SDKs
gotchaManagement Group operations, such as creating or moving groups, often require specific permissions at the tenant root scope or higher in the management group hierarchy. Insufficient permissions will result in `CloudError` or `HttpResponseError`.fixEnsure the identity used for authentication has the necessary Azure RBAC roles (e.g., 'Management Group Contributor' or 'Owner') at the appropriate scope for the desired operation. Check the Azure Activity Log for permission denied errors.
affects: All versions
Upgrade
Version history
2.0.0latest on PyPI · released Jun 29, 2026
Audit
Dependencies
azure-commonrequiredLegacy base package for Azure SDK, often implicitly required.
azure-corerequiredFoundation for modern Azure SDK clients.
azure-mgmt-corerequiredCore functionalities for Azure management plane SDKs.
msrestrequiredHTTP client library used by Azure SDKs.
msrestazurerequiredAzure-specific extensions for msrest.
azure-identityrequiredRequired for modern Azure SDK authentication (e.g., DefaultAzureCredential).