Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: fix bug missing data source type in the ARM template #896

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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
Expand All @@ -141,7 +144,6 @@ module backend 'core/host/appservice.bicep' = {
}
}


module openAi 'core/ai/cognitiveservices.bicep' = {
name: 'openai'
scope: openAiResourceGroup
Expand Down Expand Up @@ -206,7 +208,6 @@ module cosmos 'db.bicep' = {
}
}


// USER ROLES
module openAiRoleUser 'core/security/role.bicep' = {
scope: openAiResourceGroup
Expand Down Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions infrastructure/deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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')]"
Expand Down Expand Up @@ -575,7 +586,7 @@
{
"name": "UWSGI_THREADS",
"value": "2"
}
}
],
"linuxFxVersion": "[variables('WebAppImageName')]"
}
Expand Down Expand Up @@ -684,4 +695,4 @@
]
}
]
}
}