This page contains Windows bias

About This Page

This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.

Bias Analysis

Bias Types:
⚠️ powershell_heavy
⚠️ windows_first
Summary:
The documentation provides both Azure PowerShell and Azure CLI examples for all management group operations, ensuring cross-platform command-line parity. However, PowerShell examples are consistently presented before Azure CLI examples, and some example outputs (such as object inspection) use Windows/PowerShell-specific conventions (e.g., PS C:\> prompt, object property navigation), which may be less familiar to Linux/macOS users. There are no explicit Linux-only tools or shell examples, and no mention of Bash scripting or Linux shell environments.
Recommendations:
  • Alternate the order of PowerShell and Azure CLI examples, or present them side-by-side, to avoid implying PowerShell is primary.
  • Where example outputs are shown, provide equivalent Azure CLI output or note differences in output formatting between PowerShell and CLI.
  • Include brief notes clarifying that both Azure PowerShell and Azure CLI are cross-platform and can be used on Windows, Linux, and macOS.
  • Add links or references to Bash scripting or Linux shell usage where appropriate, especially for users automating with the Azure CLI.
  • Avoid using Windows-specific prompts (e.g., PS C:\>) in example outputs unless necessary; if shown, provide equivalent CLI output for parity.
GitHub Create pull request

Scan History

Date Scan ID Status Bias Status
2025-07-12 23:44 #41 in_progress ❌ Biased
2025-07-12 00:58 #8 cancelled ✅ Clean
2025-07-10 05:06 #7 processing ✅ Clean

Flagged Code Snippets

For a single management group's information, use the `-GroupId` parameter:
To return a specific management group and all the levels of the hierarchy under it, use the `-Expand` and `-Recurse` parameters:
## Move management groups and subscriptions One reason to create a management group is to bundle subscriptions together. Only management groups and subscriptions can become children of another management group. A subscription that moves to a management group inherits all user access and policies from the parent management group. You can move subscriptions between management groups. A subscription can have only one parent management group. When you move a management group or subscription to be a child of another management group, three rules need to be evaluated as true. If you're doing the move action, you need permission at each of the following layers: - Child subscription or management group - `Microsoft.management/managementgroups/write` - `Microsoft.management/managementgroups/subscriptions/write` (only for subscriptions) - `Microsoft.Authorization/roleAssignments/write` - `Microsoft.Authorization/roleAssignments/delete` - `Microsoft.Management/register/action` - Target parent management group - `Microsoft.management/managementgroups/write` - Current parent management group - `Microsoft.management/managementgroups/write` There's an exception: if the target or the existing parent management group is the root management group, the permission requirements don't apply. Because the root management group is the default landing spot for all new management groups and subscriptions, you don't need permissions on it to move an item. If the Owner role on the subscription is inherited from the current management group, your move targets are limited. You can move the subscription only to another management group where you have the Owner role. You can't move the subscription to a management group where you're only a Contributor because you would lose ownership of the subscription. If you're directly assigned to the Owner role for the subscription, you can move it to any management group where you have the Contributor role. To see what permissions you have in the Azure portal, select the management group and then select **IAM**. To learn more about Azure roles, see [What is Azure role-based access control (Azure RBAC)?](../../role-based-access-control/overview.md). ### Add an existing subscription to a management group in the portal 1. Sign in to the [Azure portal](https://portal.azure.com). 1. Select **All services**. In the **Filter services** text box, enter *Management groups* and select it from the list. 1. Select the management group that you want to be the parent. 1. At the top of the page, select **Add subscription**. 1. From **Add subscription** select the subscription in the list with the correct ID. :::image type="content" source="./media/add_context_sub.png" alt-text="Screenshot of the box for selecting an existing subscription to add to a management group." border="false"::: 1. Select **Save**. ### Remove a subscription from a management group in the portal 1. Sign in to the [Azure portal](https://portal.azure.com). 1. Select **All services**. In the **Filter services** text box, enter *Management groups* and select it from the list. 1. Select the management group that's the current parent. 1. Select the ellipsis (`...`) at the end of the row for the subscription in the list that you want to move. :::image type="content" source="./media/move_small.png" alt-text="Screenshot of the menu that includes the move option for a subscription." border="false"::: 1. Select **Move**. 1. On **Move** pane, select the value for **New parent management group ID**. :::image type="content" source="./media/move_small_context.png" alt-text="Screenshot of the pane for moving a subscription to a different management group." border="false"::: 1. Select **Save**. ### Move a subscription in Azure PowerShell To move a subscription in PowerShell, you use the `New-AzManagementGroupSubscription` command:
To remove the link between the subscription and the management group, use the `Remove-AzManagementGroupSubscription` command:
To remove the subscription from the management group, use the `subscription remove` command:
## Delete a management group To delete a management group, you must meet the following requirements: - There are no child management groups or subscriptions under the management group. To move a subscription or management group to another management group, see [Move management groups and subscriptions](#move-management-groups-and-subscriptions) later in this article. - You need write permissions on the management group (Owner, Contributor, or Management Group Contributor). To see what permissions you have, select the management group and then select **IAM**. To learn more on Azure roles, see [What is Azure role-based access control (Azure RBAC)?](../../role-based-access-control/overview.md). ### Delete a management group in the portal 1. Sign in to the [Azure portal](https://portal.azure.com). 1. Select **All services**. In the **Filter services** text box, enter *Management groups* and select it from the list. 1. Select the management group that you want to delete. 1. Select **details**. 1. Select **Delete**. :::image type="content" source="./media/delete.png" alt-text="Screenshot of the management group page with the Delete button." border="false"::: > [!TIP] > If the **Delete** button is unavailable, hovering over the button shows you the reason. 1. A dialog opens and asks you to confirm that you want to delete the management group. :::image type="content" source="./media/delete_confirm.png" alt-text="Screenshot of the confirmation dialog for deleting a management group." border="false"::: 1. Select **Yes**. ### Delete a management group in Azure PowerShell To delete a management group, use the `Remove-AzManagementGroup` command in Azure PowerShell:
## View management groups You can view any management group if you have a direct or inherited Azure role on it. ### View management groups in the portal 1. Sign in to the [Azure portal](https://portal.azure.com). 1. Select **All services**. In the **Filter services** text box, enter *Management groups* and select it from the list. 1. The page for management group hierarchy appears. On this page, you can explore all the management groups and subscriptions that you have access to. Selecting the group name takes you to a lower level in the hierarchy. The navigation works the same as a file explorer does. 1. To see the details of the management group, select the **(details)** link next to the title of the management group. If this link isn't available, you don't have permissions to view that management group. :::image type="content" source="./media/main.png" alt-text="Screenshot of the management groups page that shows child management groups and subscriptions." border="false"::: ### View management groups in Azure PowerShell You use the `Get-AzManagementGroup` command to retrieve all groups. For the full list of `GET` PowerShell commands for management groups, see the [Az.Resources](/powershell/module/az.resources/Get-AzManagementGroup) modules.
To return a specific management group and all the levels of the hierarchy under it, use the `-Expand` and `-Recurse` parameters:
### Move a management group in the portal 1. Sign in to the [Azure portal](https://portal.azure.com). 1. Select **All services**. In the **Filter services** text box, enter *Management groups* and select it from the list. 1. Select the management group that you want to be the parent. 1. At the top of the page, select **Create**. 1. On the **Create management group** pane, choose whether you want to use a new or existing management group: - Selecting **Create new** creates a new management group. - Selecting **Use existing** presents you with a dropdown list of all the management groups that you can move to this management group. :::image type="content" source="./media/add_context_MG.png" alt-text="Screenshot of the pane for adding a management group." border="false"::: 1. Select **Save**. ### Move a management group in Azure PowerShell To move a management group under a different group, use the `Update-AzManagementGroup` command in Azure PowerShell: