diff --git a/infra/main.bicep b/infra/main.bicep index 20560f807f..483c969186 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -13,6 +13,7 @@ param appServicePlanName string = '' param backendServiceName string = '' param resourceGroupName string = '' +param datasourceType string = '' param searchServiceName string = '' param searchServiceResourceGroupName string = '' param searchServiceResourceGroupLocation string = location @@ -78,7 +79,6 @@ resource searchServiceResourceGroup 'Microsoft.Resources/resourceGroups@2021-04- name: !empty(searchServiceResourceGroupName) ? searchServiceResourceGroupName : resourceGroup.name } - // Create an App Service Plan to group applications under the same payment plan and SKU module appServicePlan 'core/host/appserviceplan.bicep' = { name: 'appserviceplan' @@ -96,7 +96,9 @@ module appServicePlan 'core/host/appserviceplan.bicep' = { } // The application frontend -var appServiceName = !empty(backendServiceName) ? backendServiceName : '${abbrs.webSitesAppService}backend-${resourceToken}' +var appServiceName = !empty(backendServiceName) + ? backendServiceName + : '${abbrs.webSitesAppService}backend-${resourceToken}' var authIssuerUri = '${environment().authentication.loginEndpoint}${tenant().tenantId}/v2.0' module backend 'core/host/appservice.bicep' = { name: 'web' @@ -115,6 +117,7 @@ module backend 'core/host/appservice.bicep' = { authIssuerUri: authIssuerUri appSettings: { // search + DATASOURCE_TYPE: datasourceType AZURE_SEARCH_INDEX: searchIndexName AZURE_SEARCH_SERVICE: searchService.outputs.name AZURE_SEARCH_KEY: searchService.outputs.adminKey @@ -141,7 +144,6 @@ module backend 'core/host/appservice.bicep' = { } } - module openAi 'core/ai/cognitiveservices.bicep' = { name: 'openai' scope: openAiResourceGroup @@ -206,7 +208,6 @@ module cosmos 'db.bicep' = { } } - // USER ROLES module openAiRoleUser 'core/security/role.bicep' = { scope: openAiResourceGroup @@ -291,6 +292,7 @@ output AZURE_RESOURCE_GROUP string = resourceGroup.name output BACKEND_URI string = backend.outputs.uri // search +output DATASOURCE_TYPE string = datasourceType output AZURE_SEARCH_INDEX string = searchIndexName output AZURE_SEARCH_SERVICE string = searchService.outputs.name output AZURE_SEARCH_SERVICE_RESOURCE_GROUP string = searchServiceResourceGroup.name diff --git a/infrastructure/deployment.json b/infrastructure/deployment.json index 1bd9b488ee..4b09d4e8cd 100644 --- a/infrastructure/deployment.json +++ b/infrastructure/deployment.json @@ -44,6 +44,13 @@ "description": "Name of Application Insights" } }, + "DataSourceType": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Should be set to AzureCognitiveSearch when adding your data with Azure AI Search" + } + }, "AzureSearchService": { "type": "string", "defaultValue": "", @@ -392,6 +399,10 @@ "name": "APPINSIGHTS_INSTRUMENTATIONKEY", "value": "[reference(resourceId('Microsoft.Insights/components', parameters('ApplicationInsightsName')), '2015-05-01').InstrumentationKey]" }, + { + "name": "DATASOURCE_TYPE ", + "value": "[parameters('DataSourceType')]" + }, { "name": "AZURE_SEARCH_SERVICE", "value": "[parameters('AzureSearchService')]" @@ -575,7 +586,7 @@ { "name": "UWSGI_THREADS", "value": "2" - } + } ], "linuxFxVersion": "[variables('WebAppImageName')]" } @@ -684,4 +695,4 @@ ] } ] -} +} \ No newline at end of file