-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.json
465 lines (465 loc) · 15 KB
/
main.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
"templateHash": "3711349996173669799"
}
},
"parameters": {
"ResourcePrefix": {
"type": "string",
"metadata": {
"description": "provide a 2-13 character prefix for all resources."
}
},
"functionAppName": {
"type": "string",
"defaultValue": "[format('{0}-func-backend', parameters('ResourcePrefix'))]",
"metadata": {
"description": "The name of the Azure Function app."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
},
"HostingPlanName": {
"type": "string",
"defaultValue": "[format('{0}-hosting-plan', parameters('ResourcePrefix'))]",
"metadata": {
"description": "Name of App Service plan"
}
},
"HostingPlanSku": {
"type": "string",
"defaultValue": "B3",
"allowedValues": [
"F1",
"D1",
"B1",
"B2",
"B3",
"S1",
"S2",
"S3",
"P1",
"P2",
"P3",
"P4"
],
"metadata": {
"description": "The pricing tier for the App Service plan"
}
},
"AppInsightsConnectionString": {
"type": "securestring",
"metadata": {
"description": "Application Insights Connection String - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureCognitiveSearch": {
"type": "string",
"metadata": {
"description": "Azure Cognitive Search Resource - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureSearchIndex": {
"type": "string",
"metadata": {
"description": "Azure Cognitive Search Index - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureSearchConversationLogIndex": {
"type": "string",
"defaultValue": "conversations",
"metadata": {
"description": "Azure Cognitive Search Conversation Log Index - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureSearchKey": {
"type": "securestring",
"metadata": {
"description": "Azure Cognitive Search Key - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureSearchSemanticSearchConfig": {
"type": "string",
"defaultValue": "default",
"metadata": {
"description": "Semantic search config - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureSearchIndexIsPrechunked": {
"type": "string",
"defaultValue": "false",
"metadata": {
"description": "Is the index prechunked - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureSearchTopK": {
"type": "string",
"defaultValue": "5",
"metadata": {
"description": "Top K results - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureSearchEnableInDomain": {
"type": "string",
"defaultValue": "false",
"metadata": {
"description": "Enable in domain - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureSearchContentColumns": {
"type": "string",
"defaultValue": "content",
"metadata": {
"description": "Content columns - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureSearchFilenameColumn": {
"type": "string",
"defaultValue": "filename",
"metadata": {
"description": "Filename column - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureSearchTitleColumn": {
"type": "string",
"defaultValue": "title",
"metadata": {
"description": "Title column - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureSearchUrlColumn": {
"type": "string",
"defaultValue": "url",
"metadata": {
"description": "Url column - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAIResource": {
"type": "string",
"metadata": {
"description": "Name of Azure OpenAI Resource - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAIModel": {
"type": "string",
"defaultValue": "gpt-35-turbo",
"metadata": {
"description": "Azure OpenAI Model Deployment Name - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAIModelName": {
"type": "string",
"defaultValue": "gpt-35-turbo",
"metadata": {
"description": "Azure OpenAI Model Name - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAIKey": {
"type": "securestring",
"metadata": {
"description": "Azure OpenAI Key - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"OrchestrationStrategy": {
"type": "string",
"allowedValues": [
"openai_function",
"langchain"
],
"metadata": {
"description": "Orchestration strategy: openai_function or langchain str. If you use a old version of turbo (0301), plese select langchain - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAITemperature": {
"type": "string",
"defaultValue": "0",
"metadata": {
"description": "Azure OpenAI Temperature - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAITopP": {
"type": "string",
"defaultValue": "1",
"metadata": {
"description": "Azure OpenAI Top P - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAIMaxTokens": {
"type": "string",
"defaultValue": "1000",
"metadata": {
"description": "Azure OpenAI Max Tokens - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAIStopSequence": {
"type": "string",
"defaultValue": "\n",
"metadata": {
"description": "Azure OpenAI Stop Sequence - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAISystemMessage": {
"type": "string",
"defaultValue": "You are an AI assistant that helps people find information.",
"metadata": {
"description": "Azure OpenAI System Message - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAIApiVersion": {
"type": "string",
"defaultValue": "2023-07-01-preview",
"metadata": {
"description": "Azure OpenAI Api Version - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAIStream": {
"type": "string",
"defaultValue": "true",
"metadata": {
"description": "Whether or not to stream responses from Azure OpenAI - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureOpenAIEmbeddingModel": {
"type": "string",
"defaultValue": "text-embedding-ada-002",
"metadata": {
"description": "Azure OpenAI Embedding Model - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureFormRecognizerEndpoint": {
"type": "string",
"metadata": {
"description": "Azure Form Recognizer Endpoint - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureFormRecognizerKey": {
"type": "securestring",
"metadata": {
"description": "Azure Form Recognizer Key - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureBlobAccountName": {
"type": "string",
"metadata": {
"description": "Storage Account Name - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureBlobAccountKey": {
"type": "securestring",
"metadata": {
"description": "Storage Account Key - Created during the \"Chat with your data\" Solution Accelerator"
}
},
"AzureBlobContainerName": {
"type": "string",
"metadata": {
"description": "Storage Account Container Name - Created during the \"Chat with your data\" Solution Accelerator"
}
}
},
"variables": {
"BackendImageName": "DOCKER|fruoccopublic.azurecr.io/cwyod_backend"
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-06-01",
"name": "[parameters('HostingPlanName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('HostingPlanSku')]"
},
"properties": {
"reserved": true
},
"kind": "linux"
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[parameters('functionAppName')]",
"kind": "functionapp,linux",
"location": "[parameters('location')]",
"tags": {},
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~4"
},
{
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
"value": "false"
},
{
"name": "APPINSIGHTS_CONNECTION_STRING",
"value": "[parameters('AppInsightsConnectionString')]"
},
{
"name": "AZURE_SEARCH_SERVICE",
"value": "[format('https://{0}.search.windows.net', parameters('AzureCognitiveSearch'))]"
},
{
"name": "AZURE_SEARCH_INDEX",
"value": "[parameters('AzureSearchIndex')]"
},
{
"name": "AZURE_SEARCH_CONVERSATIONS_LOG_INDEX",
"value": "[parameters('AzureSearchConversationLogIndex')]"
},
{
"name": "AZURE_SEARCH_KEY",
"value": "[parameters('AzureSearchKey')]"
},
{
"name": "AZURE_SEARCH_SEMANTIC_SEARCH_CONFIG",
"value": "[parameters('AzureSearchSemanticSearchConfig')]"
},
{
"name": "AZURE_SEARCH_INDEX_IS_PRECHUNKED",
"value": "[parameters('AzureSearchIndexIsPrechunked')]"
},
{
"name": "AZURE_SEARCH_TOP_K",
"value": "[parameters('AzureSearchTopK')]"
},
{
"name": "AZURE_SEARCH_ENABLE_IN_DOMAIN",
"value": "[parameters('AzureSearchEnableInDomain')]"
},
{
"name": "AZURE_SEARCH_CONTENT_COLUMNS",
"value": "[parameters('AzureSearchContentColumns')]"
},
{
"name": "AZURE_SEARCH_FILENAME_COLUMN",
"value": "[parameters('AzureSearchFilenameColumn')]"
},
{
"name": "AZURE_SEARCH_TITLE_COLUMN",
"value": "[parameters('AzureSearchTitleColumn')]"
},
{
"name": "AZURE_SEARCH_URL_COLUMN",
"value": "[parameters('AzureSearchUrlColumn')]"
},
{
"name": "AZURE_OPENAI_RESOURCE",
"value": "[parameters('AzureOpenAIResource')]"
},
{
"name": "AZURE_OPENAI_KEY",
"value": "[parameters('AzureOpenAIKey')]"
},
{
"name": "AZURE_OPENAI_MODEL",
"value": "[parameters('AzureOpenAIModel')]"
},
{
"name": "AZURE_OPENAI_MODEL_NAME",
"value": "[parameters('AzureOpenAIModelName')]"
},
{
"name": "AZURE_OPENAI_TEMPERATURE",
"value": "[parameters('AzureOpenAITemperature')]"
},
{
"name": "AZURE_OPENAI_TOP_P",
"value": "[parameters('AzureOpenAITopP')]"
},
{
"name": "AZURE_OPENAI_MAX_TOKENS",
"value": "[parameters('AzureOpenAIMaxTokens')]"
},
{
"name": "AZURE_OPENAI_STOP_SEQUENCE",
"value": "[parameters('AzureOpenAIStopSequence')]"
},
{
"name": "AZURE_OPENAI_SYSTEM_MESSAGE",
"value": "[parameters('AzureOpenAISystemMessage')]"
},
{
"name": "AZURE_OPENAI_API_VERSION",
"value": "[parameters('AzureOpenAIApiVersion')]"
},
{
"name": "AZURE_OPENAI_STREAM",
"value": "[parameters('AzureOpenAIStream')]"
},
{
"name": "AZURE_OPENAI_EMBEDDING_MODEL",
"value": "[parameters('AzureOpenAIEmbeddingModel')]"
},
{
"name": "AZURE_FORM_RECOGNIZER_ENDPOINT",
"value": "[parameters('AzureFormRecognizerEndpoint')]"
},
{
"name": "AZURE_FORM_RECOGNIZER_KEY",
"value": "[parameters('AzureFormRecognizerKey')]"
},
{
"name": "AZURE_BLOB_ACCOUNT_NAME",
"value": "[parameters('AzureBlobAccountName')]"
},
{
"name": "AZURE_BLOB_ACCOUNT_KEY",
"value": "[parameters('AzureBlobAccountKey')]"
},
{
"name": "AZURE_BLOB_CONTAINER_NAME",
"value": "[parameters('AzureBlobContainerName')]"
},
{
"name": "ORCHESTRATION_STRATEGY",
"value": "[parameters('OrchestrationStrategy')]"
}
],
"cors": {
"allowedOrigins": [
"https://portal.azure.com"
]
},
"use32BitWorkerProcess": false,
"linuxFxVersion": "[variables('BackendImageName')]",
"appCommandLine": "",
"alwaysOn": true
},
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('HostingPlanName'))]",
"clientAffinityEnabled": false,
"httpsOnly": true
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('HostingPlanName'))]"
]
},
{
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2020-10-01",
"name": "WaitFunctionDeploymentSection",
"kind": "AzurePowerShell",
"location": "[parameters('location')]",
"properties": {
"azPowerShellVersion": "3.0",
"scriptContent": "start-sleep -Seconds 300",
"cleanupPreference": "Always",
"retentionInterval": "PT1H"
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('functionAppName'))]"
]
}
]
}