Skip to content

Commit

Permalink
Fix provision for load balance custom (#1396)
Browse files Browse the repository at this point in the history
* Fix provision for lb custom

* Rm unneeded parens

---------

Co-authored-by: Pamela Fox <[email protected]>
  • Loading branch information
diberry and pamelafox authored Mar 9, 2024
1 parent 68e78df commit dc80cb4
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ param appServiceSkuName string // Set in main.parameters.json

@allowed([ 'azure', 'openai', 'azure_custom' ])
param openAiHost string // Set in main.parameters.json
param isAzureOpenAiHost bool = startsWith(openAiHost, 'azure')
param azureOpenAiCustomUrl string = ''

param openAiServiceName string = ''
Expand Down Expand Up @@ -247,7 +248,7 @@ module backend 'core/host/appservice.bicep' = {
AZURE_OPENAI_CHATGPT_MODEL: chatGptModelName
AZURE_OPENAI_GPT4V_MODEL: gpt4vModelName
// Specific to Azure OpenAI
AZURE_OPENAI_SERVICE: openAiHost == 'azure' ? openAi.outputs.name : ''
AZURE_OPENAI_SERVICE: isAzureOpenAiHost ? openAi.outputs.name : ''
AZURE_OPENAI_CHATGPT_DEPLOYMENT: chatGptDeploymentName
AZURE_OPENAI_EMB_DEPLOYMENT: embeddingDeploymentName
AZURE_OPENAI_GPT4V_DEPLOYMENT: useGPT4V ? gpt4vDeploymentName : ''
Expand Down Expand Up @@ -314,7 +315,7 @@ var openAiDeployments = concat(defaultOpenAiDeployments, useGPT4V ? [
}
] : [])

module openAi 'core/ai/cognitiveservices.bicep' = if (openAiHost == 'azure') {
module openAi 'core/ai/cognitiveservices.bicep' = if (isAzureOpenAiHost) {
name: 'openai'
scope: openAiResourceGroup
params: {
Expand Down Expand Up @@ -436,7 +437,7 @@ module storage 'core/storage/storage-account.bicep' = {
// USER ROLES
var principalType = empty(runningOnGh) && empty(runningOnAdo) ? 'User' : 'ServicePrincipal'

module openAiRoleUser 'core/security/role.bicep' = if (openAiHost == 'azure') {
module openAiRoleUser 'core/security/role.bicep' = if (isAzureOpenAiHost) {
scope: openAiResourceGroup
name: 'openai-role-user'
params: {
Expand Down Expand Up @@ -509,7 +510,7 @@ module searchSvcContribRoleUser 'core/security/role.bicep' = if (!useSearchServi
}

// SYSTEM IDENTITIES
module openAiRoleBackend 'core/security/role.bicep' = if (openAiHost == 'azure') {
module openAiRoleBackend 'core/security/role.bicep' = if (isAzureOpenAiHost) {
scope: openAiResourceGroup
name: 'openai-role-backend'
params: {
Expand All @@ -519,7 +520,7 @@ module openAiRoleBackend 'core/security/role.bicep' = if (openAiHost == 'azure')
}
}

module openAiRoleSearchService 'core/security/role.bicep' = if (openAiHost == 'azure' && useIntegratedVectorization) {
module openAiRoleSearchService 'core/security/role.bicep' = if (isAzureOpenAiHost && useIntegratedVectorization) {
scope: openAiResourceGroup
name: 'openai-role-searchservice'
params: {
Expand Down Expand Up @@ -596,11 +597,11 @@ output AZURE_OPENAI_CHATGPT_MODEL string = chatGptModelName
output AZURE_OPENAI_GPT4V_MODEL string = gpt4vModelName

// Specific to Azure OpenAI
output AZURE_OPENAI_SERVICE string = (openAiHost == 'azure') ? openAi.outputs.name : ''
output AZURE_OPENAI_RESOURCE_GROUP string = (openAiHost == 'azure') ? openAiResourceGroup.name : ''
output AZURE_OPENAI_CHATGPT_DEPLOYMENT string = (openAiHost == 'azure') ? chatGptDeploymentName : ''
output AZURE_OPENAI_EMB_DEPLOYMENT string = (openAiHost == 'azure') ? embeddingDeploymentName : ''
output AZURE_OPENAI_GPT4V_DEPLOYMENT string = (openAiHost == 'azure') ? gpt4vDeploymentName : ''
output AZURE_OPENAI_SERVICE string = isAzureOpenAiHost ? openAi.outputs.name : ''
output AZURE_OPENAI_RESOURCE_GROUP string = isAzureOpenAiHost ? openAiResourceGroup.name : ''
output AZURE_OPENAI_CHATGPT_DEPLOYMENT string = isAzureOpenAiHost ? chatGptDeploymentName : ''
output AZURE_OPENAI_EMB_DEPLOYMENT string = isAzureOpenAiHost ? embeddingDeploymentName : ''
output AZURE_OPENAI_GPT4V_DEPLOYMENT string = isAzureOpenAiHost ? gpt4vDeploymentName : ''

// Used only with non-Azure OpenAI deployments
output OPENAI_API_KEY string = (openAiHost == 'openai') ? openAiApiKey : ''
Expand Down

0 comments on commit dc80cb4

Please sign in to comment.