I am trying to create an arm template that assigns RBAC role to a group at a management group level. i am able to do it via CLI and PowerShell but can't get it working via an ARM template
{
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/managementGroupDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"roleDefinitionId": {
"type": "string",
"defaultValue": "xxxx",
"metadata": {
"description": "roleDefinition for the assignment - default is reader"
}
}
},
"variables": {
"roleAssignmentName": "[guid('/', variables('xxx'), parameters('roleDefinitionId'))]"
},
"resources": [
{
"name": "[variables('roleAssignmentName')]",
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2020-04-01-preview",
"scope": "/providers/Microsoft.Management/managementGroups/xxxx",
"properties": {
"mode": "Incremental",
"roleDefinitionId": "xxx",
"principalId": "xxxx",
"principalType": "Group"
}
}
]
}
Does anyone know if MGMT Groups is supported, if yes what am i doing wrong?
Here is the official doc for ARM Role Assignment https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template, it shows to do it for Subs and Resources Groups
question from:https://stackoverflow.com/questions/66051827/arm-template-for-roleassignment-at-mgmt-group-level