Skip to content

RBAC not getting created uniquely #4568

Answered by brwilkinson
pattisanta asked this question in General
Discussion options

You must be logged in to vote

Yes this error can occur when the GUID for the role assignment is not unique AND it needs to be deterministic.

Currently you are using the following

var roleAssignGuid = guid(principalId, roleDef.id)

so lets take a look at what happens when this runs with some specific bogus guids

var roleAssignGuid = guid('abc29b64-e950-4f86-9a42-f8352d548a79', '018e806b-4f80-42d6-8b0e-67e0ccde42b9')

//or

var roleAssignGuid = guid('myuserID', 'Key Vault Secrets User')

Now imagine that I have 10 resource groups in your subscription.

If each of those used the template, to deploy and were assigning an admin access 'myuserID' at the keyvault scope as a 'Key Vault Secrets User', they would all come up with …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@brwilkinson
Comment options

Answer selected by brwilkinson
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@brwilkinson
Comment options

@brwilkinson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants