Skip to content

Commit 5dcca8b

Browse files
fix: Fixed GitHub issue Azure-Samples#1846 (Azure-Samples#1851)
1 parent f09e05f commit 5dcca8b

File tree

7 files changed

+15
-31
lines changed

7 files changed

+15
-31
lines changed

.env.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ AZURE_SEARCH_FIELDS_TAG=tag
1414
AZURE_SEARCH_FIELDS_METADATA=metadata
1515
AZURE_SEARCH_FILENAME_COLUMN=filepath
1616
AZURE_SEARCH_TITLE_COLUMN=title
17+
AZURE_SEARCH_SOURCE_COLUMN=source
18+
AZURE_SEARCH_TEXT_COLUMN=text
19+
AZURE_SEARCH_LAYOUT_TEXT_COLUMN=layoutText
1720
AZURE_SEARCH_URL_COLUMN=url
1821
AZURE_SEARCH_CONVERSATIONS_LOG_INDEX=conversations-log
1922
AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION=false

code/create_app.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,6 @@ def conversation_with_data(conversation: Request, env_helper: EnvHelper):
209209
env_helper.AZURE_SEARCH_CONTENT_VECTOR_COLUMN
210210
],
211211
"title_field": env_helper.AZURE_SEARCH_TITLE_COLUMN or None,
212-
"source_field": env_helper.AZURE_SEARCH_SOURCE_COLUMN
213-
or None,
214-
"text_field": env_helper.AZURE_SEARCH_TEXT_COLUMN or None,
215-
"layoutText_field": env_helper.AZURE_SEARCH_LAYOUT_TEXT_COLUMN
216-
or None,
217212
"url_field": env_helper.AZURE_SEARCH_FIELDS_METADATA
218213
or None,
219214
"filepath_field": (

code/tests/functional/tests/backend_api/with_byod/test_conversation_flow.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@ def test_post_makes_correct_call_to_azure_openai(
147147
"AZURE_SEARCH_FIELDS_METADATA"
148148
),
149149
"filepath_field": "filepath",
150-
"source_field": "source",
151-
"text_field": "text",
152-
"layoutText_field": "layoutText",
153150
},
154151
"filter": app_config.get("AZURE_SEARCH_FILTER"),
155152
"in_scope": True,

code/tests/test_app.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,9 +690,6 @@ def test_conversation_azure_byod_returns_correct_response_when_streaming_with_da
690690
"title_field": AZURE_SEARCH_TITLE_COLUMN,
691691
"url_field": env_helper_mock.AZURE_SEARCH_FIELDS_METADATA,
692692
"filepath_field": AZURE_SEARCH_FILENAME_COLUMN,
693-
"source_field": AZURE_SEARCH_SOURCE_COLUMN,
694-
"text_field": AZURE_SEARCH_TEXT_COLUMN,
695-
"layoutText_field": AZURE_SEARCH_LAYOUT_TEXT_COLUMN,
696693
},
697694
"filter": AZURE_SEARCH_FILTER,
698695
"in_scope": AZURE_SEARCH_ENABLE_IN_DOMAIN,

infra/core/host/functions.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ output name string = functions.outputs.name
113113
output uri string = functions.outputs.uri
114114
output azureWebJobsStorage string = useKeyVault
115115
? 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${storage.listKeys().keys[0].value};EndpointSuffix=${environment().suffixes.storage}'
116-
: storage.name
116+
: ''

infra/main.bicep

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,6 @@ param recognizedLanguages string = 'en-US,fr-FR,de-DE,it-IT'
328328
@description('Azure Machine Learning Name')
329329
param azureMachineLearningName string = 'mlw-${resourceToken}'
330330

331-
@description('Resource ID of existing Log Analytics workspace. If not provided, a new one will be created.')
332-
param existingLogAnalyticsResourceId string = ''
333-
334331
var blobContainerName = 'documents'
335332
var queueName = 'doc-processing'
336333
var clientKey = '${uniqueString(guid(subscription().id, deployment().name))}${newGuidString}'
@@ -1524,7 +1521,9 @@ output ORCHESTRATION_STRATEGY string = orchestrationStrategy
15241521
output USE_KEY_VAULT bool = useKeyVault
15251522
output AZURE_AUTH_TYPE string = authType
15261523
output BACKEND_URL string = backendUrl
1527-
output AzureWebJobsStorage string = function.outputs.AzureWebJobsStorage
1524+
output AzureWebJobsStorage string = hostingModel == 'code'
1525+
? function.outputs.AzureWebJobsStorage
1526+
: function_docker.outputs.AzureWebJobsStorage
15281527
output FUNCTION_KEY string = clientKey
15291528
output FRONTEND_WEBSITE_NAME string = hostingModel == 'code'
15301529
? web.outputs.FRONTEND_API_URI

infra/main.json

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.36.1.42791",
8-
"templateHash": "9016078693098336838"
8+
"templateHash": "9719682488284708611"
99
}
1010
},
1111
"parameters": {
@@ -663,13 +663,6 @@
663663
"metadata": {
664664
"description": "Azure Machine Learning Name"
665665
}
666-
},
667-
"existingLogAnalyticsResourceId": {
668-
"type": "string",
669-
"defaultValue": "",
670-
"metadata": {
671-
"description": "Resource ID of existing Log Analytics workspace. If not provided, a new one will be created."
672-
}
673666
}
674667
},
675668
"variables": {
@@ -8491,7 +8484,7 @@
84918484
"_generator": {
84928485
"name": "bicep",
84938486
"version": "0.36.1.42791",
8494-
"templateHash": "4946337189154540704"
8487+
"templateHash": "3041942542881708674"
84958488
}
84968489
},
84978490
"parameters": {
@@ -8690,7 +8683,7 @@
86908683
"_generator": {
86918684
"name": "bicep",
86928685
"version": "0.36.1.42791",
8693-
"templateHash": "1623075402073661527"
8686+
"templateHash": "9131982169830455839"
86948687
},
86958688
"description": "Creates an Azure Function in an existing Azure App Service plan."
86968689
},
@@ -9268,7 +9261,7 @@
92689261
},
92699262
"azureWebJobsStorage": {
92709263
"type": "string",
9271-
"value": "[if(parameters('useKeyVault'), format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', parameters('storageAccountName'), listKeys('storage', '2021-09-01').keys[0].value, environment().suffixes.storage), parameters('storageAccountName'))]"
9264+
"value": "[if(parameters('useKeyVault'), format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', parameters('storageAccountName'), listKeys('storage', '2021-09-01').keys[0].value, environment().suffixes.storage), '')]"
92729265
}
92739266
}
92749267
}
@@ -9803,7 +9796,7 @@
98039796
"_generator": {
98049797
"name": "bicep",
98059798
"version": "0.36.1.42791",
9806-
"templateHash": "4946337189154540704"
9799+
"templateHash": "3041942542881708674"
98079800
}
98089801
},
98099802
"parameters": {
@@ -10002,7 +9995,7 @@
100029995
"_generator": {
100039996
"name": "bicep",
100049997
"version": "0.36.1.42791",
10005-
"templateHash": "1623075402073661527"
9998+
"templateHash": "9131982169830455839"
100069999
},
1000710000
"description": "Creates an Azure Function in an existing Azure App Service plan."
1000810001
},
@@ -10580,7 +10573,7 @@
1058010573
},
1058110574
"azureWebJobsStorage": {
1058210575
"type": "string",
10583-
"value": "[if(parameters('useKeyVault'), format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', parameters('storageAccountName'), listKeys('storage', '2021-09-01').keys[0].value, environment().suffixes.storage), parameters('storageAccountName'))]"
10576+
"value": "[if(parameters('useKeyVault'), format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', parameters('storageAccountName'), listKeys('storage', '2021-09-01').keys[0].value, environment().suffixes.storage), '')]"
1058410577
}
1058510578
}
1058610579
}
@@ -12337,7 +12330,7 @@
1233712330
},
1233812331
"AzureWebJobsStorage": {
1233912332
"type": "string",
12340-
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('rgName')), 'Microsoft.Resources/deployments', parameters('functionName')), '2022-09-01').outputs.AzureWebJobsStorage.value]"
12333+
"value": "[if(equals(parameters('hostingModel'), 'code'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('rgName')), 'Microsoft.Resources/deployments', parameters('functionName')), '2022-09-01').outputs.AzureWebJobsStorage.value, reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('rgName')), 'Microsoft.Resources/deployments', format('{0}-docker', parameters('functionName'))), '2022-09-01').outputs.AzureWebJobsStorage.value)]"
1234112334
},
1234212335
"FUNCTION_KEY": {
1234312336
"type": "string",

0 commit comments

Comments
 (0)