-
Notifications
You must be signed in to change notification settings - Fork 1
/
groups.bicep
38 lines (35 loc) · 1023 Bytes
/
groups.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
// ****************************************
// Azure Bicep Module:
// Create multiple groups from sample JSON records
// ****************************************
@minLength(1)
param apimInstanceName string
var groupsSet = [
{
groupName: 'APIMGroup1'
groupDisplayName: 'APIM Group 1'
groupDescription: 'Description for this group'
}
{
groupName: 'APIMGroup2'
groupDisplayName: 'APIM Group 2'
groupDescription: 'Description for this group'
}
]
//parent APIM instance
resource parentAPIM 'Microsoft.ApiManagement/service@2019-01-01' existing = {
name: apimInstanceName
}
//APIM Groups
resource apimGroup 'Microsoft.ApiManagement/service/groups@2020-06-01-preview' = [for grp in groupsSet: {
parent: parentAPIM
name: grp.groupName
properties: {
displayName: grp.groupDisplayName
description: grp.groupDescription
}
}]
output apimGroups array = [for (name, i) in groupsSet: {
groupId: apimGroup[i].id
groupName: apimGroup[i].name
}]