Registry / azure / azure-mgmt-managementgroups

azure-mgmt-managementgroups

JSON →
library2.0.0pypypi✓ verified 26d ago

The `azure-mgmt-managementgroups` library provides a Microsoft Azure Management Groups Management Client for Python. It allows developers to programmatically manage Azure Management Groups, including creating, updating, deleting, and listing them. This library is part of the Azure SDK for Python, currently at version 1.1.0, and typically receives updates aligning with new Azure Management Groups API versions or SDK-wide improvements.

pip install azure-mgmt-managementgroups azure-identity
INSTALL
IMPORT
SIG · AZURE-MGMT-MANAGEM
A
azure-mgmt-managementgroups
azurepythonv2.0.0
Install
3.8s avg
Import
400ms
Disk
43MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.078s · 43.9MB
glibc
py 3.103.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).
fix
Ensure `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.
fix
Always 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.
fix
Upgrade 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`.
fix
Ensure 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).
Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
2
Resources
azure-mgmt-managementgroups — pip install azure-mgmt-managementgroups · libregistry