Skip to content

Commit

Permalink
Merge branch 'main' into feat/748/functional-test
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurarpit committed May 13, 2024
2 parents d31b662 + d917a30 commit ac2c1a8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
5 changes: 2 additions & 3 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ module hostingplan './core/host/appserviceplan.bicep' = {
tier: skuTier
}
reserved: true
tags: { Automation: 'Ignore' }
tags: { CostControl: 'Ignore' }
}
}

Expand Down Expand Up @@ -965,7 +965,7 @@ module searchRoleUser 'core/security/role.bicep' = if (authType == 'rbac') {
}

output APPLICATIONINSIGHTS_CONNECTION_STRING string = monitoring.outputs.applicationInsightsConnectionString

output AZURE_APP_SERVICE_HOSTING_MODEL string = hostingModel
output AZURE_BLOB_CONTAINER_NAME string = blobContainerName
output AZURE_BLOB_ACCOUNT_NAME string = storageAccountName
output AZURE_BLOB_ACCOUNT_KEY string = useKeyVault ? storekeys.outputs.STORAGE_ACCOUNT_KEY_NAME : ''
Expand Down Expand Up @@ -1013,7 +1013,6 @@ output AZURE_TENANT_ID string = tenant().tenantId
output DOCUMENT_PROCESSING_QUEUE_NAME string = queueName
output ORCHESTRATION_STRATEGY string = orchestrationStrategy
output USE_KEY_VAULT bool = useKeyVault
output AZURE_APP_SERVICE_HOSTING_MODEL string = hostingModel
output FRONTEND_WEBSITE_NAME string = hostingModel == 'code' ? web.outputs.FRONTEND_API_URI : web_docker.outputs.FRONTEND_API_URI
output ADMIN_WEBSITE_NAME string = hostingModel == 'code' ? adminweb.outputs.WEBSITE_ADMIN_URI : adminweb_docker.outputs.WEBSITE_ADMIN_URI
output LOGLEVEL string = logLevel
23 changes: 17 additions & 6 deletions infra/main.bicepparam
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
using './main.bicep'

param environmentName = readEnvironmentVariable('AZURE_ENV_NAME', 'env_name')

param location = readEnvironmentVariable('AZURE_LOCATION', 'location')

param principalId = readEnvironmentVariable('AZURE_PRINCIPAL_ID', 'principal_id')

// Please make sure to set this value to false when using rbac with AZURE_AUTH_TYPE
param useKeyVault = bool(readEnvironmentVariable('USE_KEY_VAULT', 'true'))

param authType = readEnvironmentVariable('AZURE_AUTH_TYPE', 'keys')

// Deploying using json will set this to "container".
param hostingModel = readEnvironmentVariable('AZURE_APP_SERVICE_HOSTING_MODEL', 'code')

// Feature flags
param azureSearchUseIntegratedVectorization = bool(readEnvironmentVariable('AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION', 'false'))
param azureSearchUseSemanticSearch = readEnvironmentVariable('AZURE_SEARCH_USE_SEMANTIC_SEARCH', 'false')
param orchestrationStrategy = readEnvironmentVariable('ORCHESTRATION_STRATEGY', 'openai_function')
param logLevel = readEnvironmentVariable('LOGLEVEL', 'INFO')
param recognizedLanguages = readEnvironmentVariable('AZURE_SPEECH_RECOGNIZER_LANGUAGES', 'en-US,fr-FR,de-DE,it-IT')

// OpenAI parameters
param azureOpenAIApiVersion = readEnvironmentVariable('AZURE_OPENAI_API_VERSION', '2024-02-01')
param azureOpenAIModel = readEnvironmentVariable('AZURE_OPENAI_MODEL', 'gpt-35-turbo-16k')
param azureOpenAIModelName = readEnvironmentVariable('AZURE_OPENAI_MODEL_NAME', 'gpt-35-turbo-16k')
param azureOpenAIModelVersion = readEnvironmentVariable('AZURE_OPENAI_MODEL_VERSION', '0613')
Expand All @@ -23,18 +30,21 @@ param azureOpenAIVisionModelName = readEnvironmentVariable('AZURE_OPENAI_VISION_
param azureOpenAIVisionModelVersion = readEnvironmentVariable('AZURE_OPENAI_VISION_MODEL_VERSION', 'vision-preview')
param azureOpenAIVisionModelCapacity = int(readEnvironmentVariable('AZURE_OPENAI_VISION_MODEL_CAPACITY', '10'))
param azureOpenAIEmbeddingModelCapacity = int(readEnvironmentVariable('AZURE_OPENAI_EMBEDDING_MODEL_CAPACITY', '30'))

param azureOpenAIEmbeddingModel = readEnvironmentVariable('AZURE_OPENAI_EMBEDDING_MODEL', 'text-embedding-ada-002')
param azureOpenAIMaxTokens = readEnvironmentVariable('AZURE_OPENAI_MAX_TOKENS', '1000')
param azureOpenAITemperature = readEnvironmentVariable('AZURE_OPENAI_TEMPERATURE', '0')
param azureOpenAITopP = readEnvironmentVariable('AZURE_OPENAI_TOP_P', '1')
param azureOpenAIStopSequence = readEnvironmentVariable('AZURE_OPENAI_STOP_SEQUENCE', '\n')
param computerVisionLocation = readEnvironmentVariable('AZURE_COMPUTER_VISION_LOCATION', '')

param azureSearchUseIntegratedVectorization = bool(readEnvironmentVariable('AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION', 'false'))

// The following are being renamed to align with the new naming convention
// we manipulate existing resources here to maintain backwards compatibility

// We need the resourceToken to be unique for each deployment (copied from the main.bicep)
var subscriptionId = readEnvironmentVariable('AZURE_SUBSCRIPTION_ID', 'subscription_id')
param resourceToken = toLower(uniqueString(subscriptionId, environmentName, location))


// Retrieve the Search Name from the Search Endpoint which will be in the format
// "https://uniquename.search.windows.net/" It will end in a slash. Bicep forces us to have a default, so we use
// a default that we can manipulate in the same way to reduce another condition.
Expand All @@ -47,3 +57,4 @@ param azureAISearchName = searchServiceName == '' ? 'search-${resourceToken}' :

param azureSearchIndex = readEnvironmentVariable('AZURE_SEARCH_INDEX', 'index-${resourceToken}')
param azureOpenAIResourceName = readEnvironmentVariable('AZURE_OPENAI_RESOURCE', 'openai-${resourceToken}')
param storageAccountName = readEnvironmentVariable('AZURE_BLOB_ACCOUNT_NAME', 'str${resourceToken}')
12 changes: 6 additions & 6 deletions infra/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.27.1.19265",
"templateHash": "10902119105781571177"
"templateHash": "17426906878691848997"
}
},
"parameters": {
Expand Down Expand Up @@ -1797,7 +1797,7 @@
},
"tags": {
"value": {
"Automation": "Ignore"
"CostControl": "Ignore"
}
}
},
Expand Down Expand Up @@ -10722,6 +10722,10 @@
"type": "string",
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', 'monitoring'), '2022-09-01').outputs.applicationInsightsConnectionString.value]"
},
"AZURE_APP_SERVICE_HOSTING_MODEL": {
"type": "string",
"value": "[parameters('hostingModel')]"
},
"AZURE_BLOB_CONTAINER_NAME": {
"type": "string",
"value": "[variables('blobContainerName')]"
Expand Down Expand Up @@ -10910,10 +10914,6 @@
"type": "bool",
"value": "[parameters('useKeyVault')]"
},
"AZURE_APP_SERVICE_HOSTING_MODEL": {
"type": "string",
"value": "[parameters('hostingModel')]"
},
"FRONTEND_WEBSITE_NAME": {
"type": "string",
"value": "[if(equals(parameters('hostingModel'), 'code'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('websiteName')), '2022-09-01').outputs.FRONTEND_API_URI.value, reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', format('{0}-docker', parameters('websiteName'))), '2022-09-01').outputs.FRONTEND_API_URI.value)]"
Expand Down

0 comments on commit ac2c1a8

Please sign in to comment.