-
Notifications
You must be signed in to change notification settings - Fork 6
/
createsubscriptionroles.bicep
59 lines (56 loc) · 1.94 KB
/
createsubscriptionroles.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
targetScope = 'subscription'
resource imageBuilderNetworkingRoleDefinition 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' = {
name: guid(subscription().id, 'Azure Image Builder Service Networking Role')
properties: {
roleName: '[Custom] Azure Image Builder Service Network Joiner'
type: 'CustomRole'
description: 'Required permissions for an Azure Image Builder Service assigned identity to use an existing vnet. Expected to be assigned at the virtual network resource (not subnet).'
assignableScopes: [
subscription().id
]
permissions: [
{
actions: [
'Microsoft.Network/virtualNetworks/read'
'Microsoft.Network/virtualNetworks/subnets/join/action'
]
notActions: []
dataActions: []
notDataActions: []
}
]
}
}
resource imageBuilderImageCreationRoleDefinition 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' = {
name: guid(subscription().id, 'Azure Image Builder Service Image Creation Role')
properties: {
roleName: '[Custom] Image Contributor'
type: 'CustomRole'
description: 'Required permissions for an Azure Image Builder Service assigned identity to deploy the generated image to a resource group. Expected to be assigned at the target RG level.'
assignableScopes: [
subscription().id
]
permissions: [
{
actions: [
'Microsoft.Compute/images/write'
'Microsoft.Compute/images/read'
'Microsoft.Compute/images/delete'
]
notActions: []
dataActions: []
notDataActions: []
}
]
}
}
output roleResourceIds object = {
customImageBuilderImageCreationRole: {
guid: imageBuilderImageCreationRoleDefinition.name
resourceId: imageBuilderImageCreationRoleDefinition.id
}
customImageBuilderNetworkingRole: {
guid: imageBuilderNetworkingRoleDefinition.name
resourceId: imageBuilderNetworkingRoleDefinition.id
}
}