-
Notifications
You must be signed in to change notification settings - Fork 757
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
Add sample for custom role definition and assignment #1045
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small tweak
} | ||
|
||
resource assignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { | ||
name: guid(concat(roleName, principalId)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of concatting these strings together, I would add arguments to the guid function (which can take as many arguments as you want to provide). I would also add the subscription id as an argument to ensure uniqueness:
name: guid(roleName, principalId, subscription().subscriptionId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good idea !
I make the small tweak
Codecov Report
@@ Coverage Diff @@
## main #1045 +/- ##
==========================================
+ Coverage 94.26% 94.73% +0.47%
==========================================
Files 328 324 -4
Lines 15810 15660 -150
Branches 12 0 -12
==========================================
- Hits 14903 14836 -67
+ Misses 907 824 -83
Flags with carried forward coverage won't be shown. Click here to find out more.
|
No description provided.