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
validResourceType", "message": "The resource type 'managementGroups' could not be found in the namespace 'Microsoft.Management' for api version '2020-04-01-preview'. The supported api-versions are '2020-10-01,2020-05-01,2020-02-01,2019-11-01,2018-03-01-preview,2018-01-01-preview,2017-11-01-preview,2017-08-31-preview,2017-06-30-preview,2017-05-31-preview,2018-03-01-beta'."
– TalkingReckless