Unable to run "az deployment mg create" on Tenant Root Group

Jose-Paolo Roldan 20 Reputation points
2024-03-12T03:36:40.1733333+00:00

Trying to deploy a management group structure via Bicep starting 1 level down from "Tenant Root Group". CLI command az deployment mg create needs to target the Tenant Root Group (which has the same ID as the Tenant ID as per https://learn.microsoft.com/en-au/azure/governance/management-groups/overview#root-management-group-for-each-directory)

However keep getting the error below (CLI: *az deployment mg create -m

Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
666 questions
Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
793 questions
{count} votes

Accepted answer
  1. SwathiDhanwada-MSFT 17,401 Reputation points
    2024-03-13T06:50:04.9233333+00:00

    @Jose-Paolo Roldan The principal deploying the template must have permissions to create resources at the tenant scope. The principal must have permission to execute the deployment actions (Microsoft.Resources/deployments/*) and to create the resources defined in the template. For example, to create a management group, the principal must have Contributor permission at the tenant scope. To create role assignments, the principal must have Owner permission.

    The Global Administrator for the Microsoft Entra ID doesn't automatically have permission to assign roles. To enable template deployments at the tenant scope, the Global Administrator must do the following steps:

    1. Elevate account access so the Global Administrator can assign roles. For more information, see Elevate access to manage all Azure subscriptions and management groups. (Seems you have already done this).
    2. Kindly assign Owner or Contributor to the principal that needs to deploy the templates.
         az role assignment create --assignee "[userId]" --scope "/" --role "Owner"
         
      

    The principal now has the required permissions to deploy the template.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful