-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic naming for role assignments #5105
Comments
Definitely get the desire for this, but I don't think this is something likely to change. It would be up to the Authorization RP team to make a change like this, so it's not up to us. If the name is |
I meant that |
It would be difficult to justify doing something specifically for roleAssignments, but it might be interesting to explore a more generic "auto-naming" capability for all resource types. |
As I said above, it could be generalized by using the |
The question is what properties to choose automatically? Does there need to be some sort of mapping that says something like:
At that point it becomes a question of who maintains that list and what would the fallback behavior be? We also need to ask how useful is a guid for a resource name when it's not explicitly required? I'd much prefer the Authorization RP figures out how to relax the guid requirement. |
Why not use all properties for any resource? I doubt it can be solved by the auth RP - the ARM contract requires operations to be idempotent, which means a PUT must include the resource identifier. And the identifier needs to be globally unique, which is why a GUID is a good choice. Plus the fact the RP doesn't allow duplicate entries (that is ones that differ by ID but have the same role assignment properties) - which is why this is difficult. |
@aelij you cannot use all properties as some of these can be changed. For example if you change the description that does not result in new name and thus new role created. |
Hmm, yes. Then perhaps an API spec extension that defines those properties (e.g. This could also be used by Azure SDKs which now produce a random GUID for role assignments. That makes it difficult to migrate an existing assignment to Bicep. |
What about this idea? |
Hi aelij, this issue has been marked as stale because it was labeled as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thanks for contributing to bicep! 😄 🦾 |
Not stale |
Is your feature request related to a problem? Please describe.
Role assignment naming is hard to get right in ARM. I think the best way of doing it is using the
guid
function to hash all the parameters of the role assignment. This way templates remain fully idempotent, and avoid "role assignment exists" errors.Describe the solution you'd like
name
would be equal toguid(scope, roleDefinitionId, principalId, principalType)
(or perhaps generalized as,guid(scope, prop1, prop2, ...)
. This also forcesprincipalId
(and other parameters) to be statically-known - which is great since using dynamic values makes the name non-idempotent.Note this can also be used for Cosmos's
Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments
(and possibly others).The text was updated successfully, but these errors were encountered: