How can I add RBAC roles to a Azure AD group in bicep format?

Emran Hossain 190 Reputation points

Hi ,

I have a assignment for my company client " Create a bicep file for AAD groups to Azure RBAC Role in Key Vault , App configuration, Azure Service Bus " (Solution will be by Bicep)

I did not get any idea anywhere

if someone come to help me here

Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
603 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,075 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
18,714 questions
0 comments No comments
{count} votes

Accepted answer
  1. Shweta Mathur 25,471 Reputation points Microsoft Employee

    Hi @Emran Hossain ,

    Thanks for reaching out.

    There is no direct template available for your requirement.

    However, you can leverage the samples provided to create a bicep file accordingly.

    Currently you cannot create a group with bicep template. Our team is working on an MS Graph (AAD) provider for Bicep so you can create App registrations and other AAD objects, but don't have a clear ETA as of now.

    You can create a group using Graph API and then assign roles to the group using principal Id where you can assign the object Id of a group.

    resource keyVaultRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
      name: guid(subscription().id, 'keyVaultRoleAssignment', keyVaultName,
      scope: resourceGroup(keyVaultName)
      properties: {
        roleDefinitionId: '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/027d7fcf-ec02-4c6f-b5bf-935c71b4ba42' // Key Vault Contributor
    resource appConfigRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
      name: guid(subscription().id, 'appConfigRoleAssignment', appConfigName,
      scope: resourceGroup(appConfigName)
      properties: {
        roleDefinitionId: '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/4d97b98b-1d4f-4787-a291-c67834d212e7' // App Configuration Data Owner
    resource serviceBusRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
      name: guid(subscription().id, 'serviceBusRoleAssignment', serviceBusName,
      scope: resourceGroup(serviceBusName)
      properties: {
        roleDefinitionId: '/subscriptions/${subscription().subscriptionId}/providers

    Hope this will help.



    Please remember to "Accept Answer" if answer helped you.

0 additional answers

Sort by: Most helpful