canonical: https://jentic.com/apis/azure.com/azure-management-groups

# Microsoft Azure Management Groups

Jentic publishes the only available OpenAPI specification for Management Groups, keeping it validated and agent-ready. The Azure Management Groups API organises subscriptions into a hierarchical tree so policy, RBAC, and cost governance can be applied at scale across a tenant. Use it to create and update management groups, move subscriptions between groups, walk the descendant tree, and check whether a group ID is available before creating it. The API is hosted on Azure Resource Manager and authenticated through Azure Active Directory OAuth 2.0.

## For AI agents

Build and reorganise Azure management group hierarchies, attach subscriptions to groups, and resolve descendants so policy and RBAC can be applied tenant-wide. Useful for landing-zone automation and tenant restructuring.

## Scope

Does not handle policy assignment, RBAC role definitions, or billing - use for organising Azure subscriptions into a management group hierarchy only.

## Capabilities

- Create or update a management group with a parent group ID to extend the tenant hierarchy
- Attach a subscription to a specific management group so inherited policies and roles apply
- List the full descendant tree from a management group, paging through nested groups and subscriptions
- Check name availability for a candidate management group ID before provisioning
- Detach a subscription from a management group when reassigning ownership
- Trigger a tenant backfill to enrol existing subscriptions into the default management group

## Use cases

### Stand up an Azure landing zone hierarchy

Platform teams use the Management Groups API to provision a multi-level hierarchy that maps to their organisational structure: root, platform, landing zones, and workload groups. Each PUT call creates a child group under a chosen parent, and subsequent calls attach the relevant subscriptions. This is the foundation Azure Policy and RBAC inheritance rely on, and it can be wholly automated from a CMDB or Terraform plan.

Example prompt: Read the desired hierarchy from a JSON file, then for each node call PUT /providers/Microsoft.Management/managementGroups/{groupId} with the parent ID until the tree is in place.

### Reorganise subscriptions during a merger

During acquisitions or business-unit changes, subscriptions need to move between management groups so the right policies apply. The API supports attaching a subscription to a new group with a single PUT call and detaching with DELETE. Walking the descendants endpoint first lets the agent build a before-and-after picture for change approval.

Example prompt: List descendants of the source group, identify subscriptions to move, then PUT /providers/Microsoft.Management/managementGroups/{newGroupId}/subscriptions/{subscriptionId} for each one.

### Audit tenant-wide management group membership

Governance teams call the descendants endpoint at the tenant root to enumerate every group and subscription, producing a flat report that maps each subscription to its full ancestor chain. The output is used to verify that policy assignments at higher levels reach the workloads they are intended to govern.

Example prompt: Call GET /providers/Microsoft.Management/managementGroups/{rootGroupId}/descendants paging through all results and emit one row per subscription with its full parent chain.

### Agent-driven hierarchy refactor

Through Jentic, an AI agent receives a natural-language brief such as 'create a Sandbox management group under Tenant Root and move dev subscriptions into it'. The agent searches Jentic, loads the ManagementGroups create-or-update operation, executes the call, then loops the subscription move operation. Jentic injects the Azure AD token at execution time so the agent never handles raw credentials.

Example prompt: Use Jentic search for 'create azure management group', load the operation, supply parent group ID and display name, execute, then chain the ManagementGroupSubscriptions_Create call for each target subscription.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| PUT | /providers/Microsoft.Management/managementGroups/{groupId} | Create or update a management group |
| GET | /providers/Microsoft.Management/managementGroups/{groupId} | Get a management group by ID |
| GET | /providers/Microsoft.Management/managementGroups/{groupId}/descendants | List all descendant groups and subscriptions |
| PUT | /providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId} | Attach a subscription to a management group |
| DELETE | /providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId} | Detach a subscription from a management group |
| POST | /providers/Microsoft.Management/checkNameAvailability | Check whether a candidate management group ID is available |
| POST | /providers/Microsoft.Management/getEntities | Return all entities visible to the caller |

## Key resources

- **ManagementGroups** — List, get, create, update, and delete management groups; walk descendants to inspect the hierarchy.
- **ManagementGroupSubscriptions** — Attach or detach subscriptions to or from a management group.
- **Entities** — Return the full set of entities the caller can see, useful for building tenant-wide trees in one call.
- **Operations** — Enumerate the Microsoft.Management resource provider operations for RBAC tooling.
- **TenantBackfill** — Start and check the status of a tenant-wide backfill that enrols existing subscriptions into the root group.

## Why Jentic

- **Setup:** Wiring the Management Groups API by hand means setting up MSAL and an Azure AD service principal, minting bearer tokens against management.azure.com, paging the descendants tree via nextLink, and handling the six-level depth limit yourself. Through Jentic you install once, import Management Groups from the API Directory, store the service principal credentials once, and your agent calls it.
- **Permission scoping:** The group id and subscription id travel in the URL path (/managementGroups/{groupId}, /managementGroups/{groupId}/subscriptions/{subscriptionId}), so a rule can pin your agent to named groups. You choose the operations it may call, so detaching a subscription or deleting a management group is not included unless you add it.
- **Credential handling:** Your Azure AD application credentials are stored once, encrypted, by your own Jentic One instance and exchanged for a short-lived ARM-scoped bearer token at execution time. The raw secret never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create an azure management group' or 'move a subscription between management groups', and Jentic returns the matching ManagementGroups or ManagementGroupSubscriptions operation with its typed input schema so the agent calls the right endpoint without browsing the Azure REST docs.

## Related APIs

- **Subscription Client** — List and inspect the subscriptions that get attached to management groups.
- **Policy Client** — Assign Azure Policies at management group scope to enforce governance hierarchy-wide.
- **Authorization Management Client** — Assign RBAC roles at management group scope so principals inherit access to descendants.
- **Resource Management Client** — Operates at the resource group and resource level rather than the tenant hierarchy level.

## FAQ

### Why is there no official OpenAPI spec for Management Groups?

Microsoft Azure does not publish a standalone OpenAPI specification for the management groups resource provider. Jentic generates and maintains this spec so that AI agents and developers can call Management Groups via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Management Groups API use?

The API uses Azure Active Directory OAuth 2.0 via the azure_auth scheme with the user_impersonation scope on https://management.azure.com/. Through Jentic, the Azure AD client credentials are stored encrypted in the vault and exchanged for a short-lived bearer token at execution time.

### Can I move a subscription between management groups with this API?

Yes. Call PUT /providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId} to attach a subscription to a target group. The previous attachment is replaced - Azure does not require a separate detach step for the move case.

### What are the rate limits for the Management Groups API?

Azure Resource Manager applies the standard subscription read and write throttles, with x-ms-ratelimit-remaining-* headers in every response. Tenant-level operations such as descendants listing are paginated, so agents should follow the nextLink header rather than making large parallel calls.

### How do I build a hierarchy through Jentic?

Search Jentic for 'create azure management group', load the ManagementGroups_CreateOrUpdate operation, supply the desired groupId, displayName, and parent details.parent.id, and execute. Repeat for each child node, ensuring the parent exists before its children.

### How deep can the management group hierarchy go?

Azure supports up to six levels of management groups under the tenant root, plus the subscription level. The API does not enforce this client-side, but PUT calls fail with a validation error when the depth limit is reached, which agents should handle and surface.

### Does the API expose all entities in one call?

Yes. POST /providers/Microsoft.Management/getEntities returns every group, subscription, and tenant the caller has visibility into, which is faster than walking ManagementGroups_GetDescendants per group when building a tenant-wide tree.

### Can I limit what my agent is allowed to do with the Microsoft Azure Management Groups API?

Yes. Because you run Jentic One yourself, your own rules decide which of the 13 operations the agent may call, so you can allow it to create or update groups and attach subscriptions while withholding destructive calls like detaching a subscription or deleting a management group. The group ID and subscription ID travel in the URL path, so a rule can pin the agent to named management groups rather than the whole tenant. Your Azure AD credentials stay under your control and are exchanged for a short-lived token only when an allowed operation runs.
