Skip to content

Commit

Permalink
Better conditional (#1260)
Browse files Browse the repository at this point in the history
  • Loading branch information
pamelafox authored Feb 9, 2024
1 parent 385a2fc commit 72009ae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions infra/core/search/search-services.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ param replicaCount int = 1
])
param semanticSearch string = 'disabled'

var searchIdentityProvider = (sku.name == 'free') ? null : {
type: 'SystemAssigned'
}

resource search 'Microsoft.Search/searchServices@2021-04-01-preview' = {
name: name
location: location
tags: tags
// The free tier does not support managed identity
identity: (sku.name == 'free') ? null : {
type: 'SystemAssigned'
}
identity: searchIdentityProvider
properties: {
authOptions: authOptions
disableLocalAuth: disableLocalAuth
Expand All @@ -62,4 +64,4 @@ resource search 'Microsoft.Search/searchServices@2021-04-01-preview' = {
output id string = search.id
output endpoint string = 'https://${name}.search.windows.net/'
output name string = search.name
output principalId string = (sku.name == 'free') ? '' : search.identity.principalId
output principalId string = !empty(searchIdentityProvider) ? search.identity.principalId : ''

0 comments on commit 72009ae

Please sign in to comment.