File tree Expand file tree Collapse file tree 4 files changed +21
-11
lines changed Expand file tree Collapse file tree 4 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01
44
44
name : deployment .name
45
45
properties : {
46
46
model : deployment .model
47
- raiPolicyName : contains ( deployment , 'raiPolicyName' ) ? deployment . raiPolicyName : null
47
+ raiPolicyName : deployment .? raiPolicyName ?? null
48
48
}
49
- sku : contains ( deployment , 'sku' ) ? deployment . sku : {
49
+ sku : deployment .? sku ?? {
50
50
name : 'Standard'
51
51
capacity : 20
52
52
}
Original file line number Diff line number Diff line change @@ -21,9 +21,19 @@ module containerAppsEnvironment 'container-apps-environment.bicep' = {
21
21
}
22
22
}
23
23
24
- module containerRegistry 'container-registry.bicep' = {
24
+ module containerRegistryInCustomRG 'container-registry.bicep' = if (!empty (containerRegistryResourceGroupName )) {
25
+ name : '${name }-container-registry'
26
+ scope : resourceGroup (containerRegistryResourceGroupName )
27
+ params : {
28
+ name : containerRegistryName
29
+ location : location
30
+ adminUserEnabled : containerRegistryAdminUserEnabled
31
+ tags : tags
32
+ }
33
+ }
34
+
35
+ module containerRegistryInCurrentRG 'container-registry.bicep' = if (empty (containerRegistryResourceGroupName )) {
25
36
name : '${name }-container-registry'
26
- scope : !empty (containerRegistryResourceGroupName ) ? resourceGroup (containerRegistryResourceGroupName ) : resourceGroup ()
27
37
params : {
28
38
name : containerRegistryName
29
39
location : location
@@ -36,5 +46,5 @@ output defaultDomain string = containerAppsEnvironment.outputs.defaultDomain
36
46
output environmentName string = containerAppsEnvironment .outputs .name
37
47
output environmentId string = containerAppsEnvironment .outputs .id
38
48
39
- output registryLoginServer string = containerRegistry .outputs .loginServer
40
- output registryName string = containerRegistry .outputs .name
49
+ output registryLoginServer string = ! empty ( containerRegistryResourceGroupName ) ? containerRegistryInCustomRG . outputs . loginServer : containerRegistryInCurrentRG .outputs .loginServer
50
+ output registryName string = ! empty ( containerRegistryResourceGroupName ) ? containerRegistryInCustomRG . outputs . name : containerRegistryInCurrentRG .outputs .name
Original file line number Diff line number Diff line change @@ -13,11 +13,11 @@ resource keyVaultSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = [for se
13
13
tags : tags
14
14
properties : {
15
15
attributes : {
16
- enabled : contains ( secret , 'enabled' ) ? secret . enabled : true
17
- exp : contains ( secret , 'exp' ) ? secret . exp : 0
18
- nbf : contains ( secret , 'nbf' ) ? secret . nbf : 0
16
+ enabled : secret .? enabled ?? true
17
+ exp : secret .? exp ?? 0
18
+ nbf : secret .? nbf ?? 0
19
19
}
20
- contentType : contains ( secret , 'contentType' ) ? secret . contentType : 'string'
20
+ contentType : secret .? contentType ?? 'string'
21
21
value : secret .value
22
22
}
23
23
}]
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ resource storage 'Microsoft.Storage/storageAccounts@2023-01-01' = {
62
62
resource container 'containers' = [for container in containers : {
63
63
name : container .name
64
64
properties : {
65
- publicAccess : contains ( container , 'publicAccess' ) ? container . publicAccess : 'None'
65
+ publicAccess : container .? publicAccess ?? 'None'
66
66
}
67
67
}]
68
68
}
You can’t perform that action at this time.
0 commit comments