-
Notifications
You must be signed in to change notification settings - Fork 762
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
New Example: SIG with Image Definition and Role Assignment #1251
Conversation
…ignment New Example: Shared Image Gallery with Image Defintition and Role Assignment
Codecov Report
@@ Coverage Diff @@
## main #1251 +/- ##
=======================================
Coverage 94.49% 94.49%
=======================================
Files 336 336
Lines 16835 16835
Branches 14 14
=======================================
Hits 15908 15908
Misses 927 927
Flags with carried forward coverage won't be shown. Click here to find out more. |
param principalID string | ||
param templateImageResourceGroup string | ||
|
||
var assignableScopes = '/subscriptions/${azureSubscriptionID}/resourcegroups/${templateImageResourceGroup}' |
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.
since this is just a single value, I would say assignableScope
or possibly something like imageResourceGroupId
to be more specific.
I'm assuming that this resourceGroup could be in a different rg than the target of the deployment? Otherwise, you could use resourceGroup().id
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.
Thanks, that makes sense! I changed it to templateImageResourceGroupId to match the existing parameter templateImageResourceGroup.
|
||
//create role assignment | ||
resource galleryass 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { | ||
name: guid(resourceGroup().id) |
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.
This guid()
function needs some more arguments. If I did another role assignment to the same rg with different properties and used only the rg id as an argument, I would get a conflict. I'd recommend adding the roleDefinition id and principal id:
guid(resourceGroup().id, gallerydef.id, 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.
Thanks, updated!
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 tweaks
Processed suggested changes
Now also updating the transpiled json result
New Example: Shared Image Gallery with Image Definition and Role Assignment