Skip to content

Commit 72009ae

Browse files
authored
Better conditional (#1260)
1 parent 385a2fc commit 72009ae

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

infra/core/search/search-services.bicep

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ param replicaCount int = 1
3636
])
3737
param semanticSearch string = 'disabled'
3838

39+
var searchIdentityProvider = (sku.name == 'free') ? null : {
40+
type: 'SystemAssigned'
41+
}
42+
3943
resource search 'Microsoft.Search/searchServices@2021-04-01-preview' = {
4044
name: name
4145
location: location
4246
tags: tags
4347
// The free tier does not support managed identity
44-
identity: (sku.name == 'free') ? null : {
45-
type: 'SystemAssigned'
46-
}
48+
identity: searchIdentityProvider
4749
properties: {
4850
authOptions: authOptions
4951
disableLocalAuth: disableLocalAuth
@@ -62,4 +64,4 @@ resource search 'Microsoft.Search/searchServices@2021-04-01-preview' = {
6264
output id string = search.id
6365
output endpoint string = 'https://${name}.search.windows.net/'
6466
output name string = search.name
65-
output principalId string = (sku.name == 'free') ? '' : search.identity.principalId
67+
output principalId string = !empty(searchIdentityProvider) ? search.identity.principalId : ''

0 commit comments

Comments
 (0)