azure-docs
azure-docs copied to clipboard
Custom RBAC role creation with Bicep should be partially rewritten
Current guidance on page suggest changing value of name property manually. This kind of manual steps should be avoided.
Other documentation states that properties.roleName must be unique on tenant: This display name must be unique at the scope of the Azure AD tenant. Can include letters, numbers, spaces, and special characters. Maximum number of characters is 512.
After knowing this name property can be generated with guid(roleName).
After this change template can be re-deployed after permission and assignableScopes changes without changing name input and copying resource id into template parameters.
The correct usage of guid() function with predictable inputs is currently under-documented on multiple template-related documentation.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: e71a7c84-c468-68dd-594f-8a9a191e32bb
- Version Independent ID: 01c43d06-91ff-96a9-49f3-df37dfe735d5
- Content: Create or update Azure custom roles using Bicep - Azure RBAC
- Content Source: articles/role-based-access-control/custom-roles-bicep.md
- Service: role-based-access-control
- GitHub Login: @rolyon
- Microsoft Alias: rolyon
@jikuja
Thanks for your feedback! We will investigate and update as appropriate.
@jikuja Thanks for bringing this to our attention. I'm going to assign this to the document author so they can take a look at it accordingly.
@rolyon Can you please check and add your comments on this doc update request as applicable.
Role assignments with bicep documentation has a good explanation how and why use deterministic naming with guid-typed name property: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/scenarios-rbac#name
Hi @jikuja Thanks for taking the time to provide this feedback. This looks like a much easier way to create and update custom roles. The templates are maintained in different repo. I'll check into how to update the template. thanks
@rolyon Any update on this case?
Hi @jikuja Thanks for your feedback. We've incorporated your feedback into the doc. https://learn.microsoft.com/en-us/azure/role-based-access-control/custom-roles-bicep Let us know if you have any additional feedback. thanks
#please-close