mercure_01
mercure_01

Reputation: 23

ARM Create nested Management Group

I try to create an ARM Template for building the ground structure with ManagementGroups and Subscriptions. My current problem is that I can't create nested Management Groups, did somebody already something similiar?

I already have seen this Doc Article:

https://learn.microsoft.com/en-us/azure/templates/microsoft.management/managementgroups?tabs=json

Upvotes: 1

Views: 453

Answers (1)

kwill
kwill

Reputation: 11008

See https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-to-management-group?tabs=azure-cli#management-group

You need to specify properties.details.parent.id:

"resources": [
    {
        "name": "[parameters('mgName')]",
        "type": "Microsoft.Management/managementGroups",
        "apiVersion": "2020-05-01",
        "scope": "/",
        "location": "eastus",
        "properties": {
            "details": {
                "parent": {
                    "id": "[tenantResourceId('Microsoft.Management/managementGroups', parameters('parentMG'))]"
                }
            }
        }
    }
],

Upvotes: 2

Related Questions