Skip to content

Commit 83c2c40

Browse files
fixing search service name
1 parent 19f4c45 commit 83c2c40

2 files changed

Lines changed: 11 additions & 25 deletions

File tree

infra/main.bicep

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,16 @@ param vmAdminPassword string?
101101
param tags resourceInput<'Microsoft.Resources/resourceGroups@2025-04-01'>.tags = {}
102102

103103
@description('Optional. Enable monitoring applicable resources, aligned with the Well Architected Framework recommendations. This setting enables Application Insights and Log Analytics and configures all the resources applicable resources to send logs. Defaults to false.')
104-
param enableMonitoring bool = true
104+
param enableMonitoring bool = false
105105

106106
@description('Optional. Enable scalability for applicable resources, aligned with the Well Architected Framework recommendations. Defaults to false.')
107-
param enableScalability bool = true
107+
param enableScalability bool = false
108108

109109
@description('Optional. Enable redundancy for applicable resources, aligned with the Well Architected Framework recommendations. Defaults to false.')
110110
param enableRedundancy bool = false
111111

112112
@description('Optional. Enable private networking for applicable resources, aligned with the Well Architected Framework recommendations. Defaults to false.')
113-
param enablePrivateNetworking bool = true
113+
param enablePrivateNetworking bool = false
114114

115115
@description('Optional. The Container Registry hostname where the docker images are located.')
116116
param acrName string = 'testapwaf'
@@ -333,7 +333,7 @@ var privateDnsZones = [
333333
'privatelink.services.ai.azure.com'
334334
'privatelink.blob.${environment().suffixes.storage}'
335335
'privatelink.queue.${environment().suffixes.storage}'
336-
'privatelink.mongo.cosmos.azure.com'
336+
'privatelink.documents.azure.com'
337337
'privatelink.vaultcore.azure.net'
338338
'privatelink.azurewebsites.net'
339339
'privatelink.search.windows.net'
@@ -1000,11 +1000,11 @@ module saveSecretsInKeyVault 'br/public:avm/res/key-vault/vault:0.12.1' = {
10001000
{name: 'AZURE-SEARCH-INDEX', value: 'pdf_index'}
10011001
{
10021002
name: 'AZURE-SEARCH-SERVICE'
1003-
value: aiSearch.name
1003+
value: aiSearch.outputs.name
10041004
}
10051005
{
10061006
name: 'AZURE-SEARCH-ENDPOINT'
1007-
value: 'https://${aiSearch.name}.search.windows.net'
1007+
value: 'https://${aiSearch.outputs.name}.search.windows.net'
10081008
}
10091009
{name: 'AZURE-OPENAI-EMBEDDING-MODEL', value: embeddingModel}
10101010
{
@@ -1107,7 +1107,7 @@ module webSite 'modules/web-sites.bicep' = {
11071107
// WEBSITES_PORT: '3000'
11081108
// WEBSITES_CONTAINER_START_TIME_LIMIT: '1800' // 30 minutes, adjust as needed
11091109
AUTH_ENABLED: 'false'
1110-
AZURE_SEARCH_SERVICE: aiSearch.name
1110+
AZURE_SEARCH_SERVICE: aiSearch.outputs.name
11111111
AZURE_SEARCH_INDEX: 'pdf_index'
11121112
AZURE_SEARCH_USE_SEMANTIC_SEARCH: 'False'
11131113
AZURE_SEARCH_SEMANTIC_SEARCH_CONFIG: 'my-semantic-config'
@@ -1156,22 +1156,8 @@ module webSite 'modules/web-sites.bicep' = {
11561156
vnetRouteAllEnabled: enablePrivateNetworking ? true : false
11571157
vnetImagePullEnabled: enablePrivateNetworking ? true : false
11581158
virtualNetworkSubnetId: enablePrivateNetworking ? network!.outputs.subnetWebResourceId : null
1159-
publicNetworkAccess: enablePrivateNetworking ? 'Disabled' : 'Enabled'
1160-
privateEndpoints: enablePrivateNetworking
1161-
? [
1162-
{
1163-
name: 'pep-${webSiteResourceName}'
1164-
customNetworkInterfaceName: 'nic-${webSiteResourceName}'
1165-
privateDnsZoneGroup: {
1166-
privateDnsZoneGroupConfigs: [{ privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.appService]!.outputs.resourceId }]
1167-
}
1168-
service: 'sites'
1169-
subnetResourceId: network!.outputs.subnetPrivateEndpointsResourceId
1170-
}
1171-
]
1172-
: null
1159+
publicNetworkAccess: 'Enabled'
11731160
}
1174-
scope: resourceGroup(resourceGroup().name)
11751161
}
11761162

11771163
@description('Contains WebApp URL')
@@ -1202,7 +1188,7 @@ output aiFoundryRgName string = aiFoundryAiServices!.outputs.resourceGroupName
12021188
output aiFoundryResourceId string = aiFoundryAiServices!.outputs.resourceId
12031189

12041190
@description('Contains AI Search Service Name')
1205-
output aiSearchServiceName string = aiSearch.name
1191+
output aiSearchServiceName string = aiSearch.outputs.name
12061192

12071193
@description('Contains Azure Search Connection Name')
12081194
output azureSearchConnectionName string = aiSearchConnectionName

src/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ async def send_chat_request(request_body, request_headers) -> AsyncGenerator[Dic
357357
tool_choice={"type": "azure_ai_search"}
358358
)
359359
if run.status == "failed":
360-
raise Exception(f"Run failed: {run.error_message}")
360+
raise Exception(f"Run failed: {run.last_error}")
361361
else:
362362
await extract_citations_from_run_steps(browse_project_client, thread.id, run.id, answer, streamed_titles)
363363
messages = browse_project_client.agents.messages.list(thread_id=thread.id)
@@ -419,7 +419,7 @@ async def send_chat_request(request_body, request_headers) -> AsyncGenerator[Dic
419419
tool_choice={"type": "azure_ai_search"}
420420
)
421421
if run.status == "failed":
422-
raise Exception(f"Run failed: {run.error_message}")
422+
raise Exception(f"Run failed: {run.last_error}")
423423
else:
424424
await extract_citations_from_run_steps(template_project_client, thread.id, run.id, answer)
425425
messages = template_project_client.agents.messages.list(thread_id=thread.id)

0 commit comments

Comments
 (0)