-
Notifications
You must be signed in to change notification settings - Fork 1
/
NameValues.bicep
48 lines (45 loc) · 1.15 KB
/
NameValues.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
// ****************************************
// Azure Bicep Module:
// Create Name / Value pairs from sample JSON records
// ****************************************
@minLength(1)
param apimInstanceName string
//Name-Value Pair records
var apimNameValueSet = [
{
displayName: 'NameValue1'
value: 'SomeValue1'
tags: [
'Example'
]
isSecret: false
}
{
displayName: 'NameSecretValue'
value: 'SomeSecretValue'
tags: [
'Example'
'AnotherExampleTag'
]
isSecret: true
}
]
//parent APIM instance
resource parentAPIM 'Microsoft.ApiManagement/service@2019-01-01' existing = {
name: apimInstanceName
}
//APIM name value pairs
resource apiManagementNVPair 'Microsoft.ApiManagement/service/namedValues@2020-06-01-preview' = [for nv in apimNameValueSet: {
parent: parentAPIM
name: nv.displayName
properties: {
displayName: nv.displayName
secret: nv.isSecret
value: nv.value
tags: nv.tags
}
}]
output apimNameValues array = [for (nv, i) in apimNameValueSet: {
nameValueId: apiManagementNVPair[i].id
nameValueName: apiManagementNVPair[i].name
}]