Please take a look here
param principalId string
@description('This is the built-in Contributor role. See https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#contributor')
resource contributorRoleDefinition 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' existing = {
scope: subscription()
name: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
}
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, principalId, contributorRoleDefinition.id)
properties: {
roleDefinitionId: contributorRoleDefinition.id
principalId: principalId
principalType: 'ServicePrincipal'
}
}
Id for Contributor
role is b24988ac-6180-42a0-ab88-20f7382dd24c
, and for Owner
it is 8e3af657-a8ff-443c-a75c-2fe8c4bcb635
.
You just need to provide principal id for your AD groups.