Skip to content

Commit 90c30e3

Browse files
committed
Updates based on feedback
1 parent 0fd4bd2 commit 90c30e3

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

modules/virtual-machine-windows/v1/.bicep/rbac.bicep

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ param resource string
3333
// VARIABLES
3434
// ---------
3535

36+
// Map of common RBAC role names to their IDs.
37+
// Azure uses specific GUIDs for built-in roles however it is easier to reference them by name.
3638
var roles = {
3739
Owner: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')
3840
Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
@@ -46,9 +48,8 @@ var roles = {
4648
'9980e02c-c2be-4d73-94e8-173b1dc7cf3c'
4749
)
4850
}
49-
var roleDefinitionId = contains(roles, role)
50-
? roles[role]
51-
: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', role)
51+
52+
var roleDefinitionId = roles[?role] ?? subscriptionResourceId('Microsoft.Authorization/roleDefinitions', role)
5253

5354
// ---------
5455
// RESOURCES

modules/virtual-machine-windows/v1/main.bicep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
// Create or update a Virtual Machine
55
targetScope = 'resourceGroup'
6+
67
metadata name = 'Virtual Machine - Windows Server'
78
metadata description = 'Deploys and configures a Windows Server Virtual Machine. VM will automatically domain join and configure monitoring.'
89
metadata version = '1.0.0'

0 commit comments

Comments
 (0)