-1

I have a questions regarding "How can I add roles to a Azure AD group in bicep format" Is it possible , i will not be able to do that . If someone know ,please share with me

I have a Project to make it Possible by BICEP Solution

I have a some groups in Azure ad & i have to make bicep file to make those groups to Owner & Contributor permission in Storage account

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120

1 Answers1

1

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.

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107