-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.bicep
584 lines (518 loc) · 20 KB
/
deployment.bicep
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
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
@description('provide a 2-13 character prefix for all resources.')
param ResourcePrefix string
@description('Location for all resources.')
param Location string = resourceGroup().location
@description('Name of App Service plan')
param HostingPlanName string = '${ResourcePrefix}-hosting-plan'
@description('The pricing tier for the App Service plan')
@allowed([
'F1'
'D1'
'B1'
'B2'
'B3'
'S1'
'S2'
'S3'
'P1'
'P2'
'P3'
'P4'
])
param HostingPlanSku string = 'B3'
@description('Name of Web App')
param WebsiteName string = '${ResourcePrefix}-website'
@description('Name of Log Analytics Workspace for App Insights')
param logAnalyticsWorkspaceName string = '${ResourcePrefix}-loganalytics'
@description('Name of Application Insights')
param ApplicationInsightsName string = '${ResourcePrefix}-appinsights'
@description('Use semantic search')
param AzureSearchUseSemanticSearch string = 'false'
@description('Semantic search config')
param AzureSearchSemanticSearchConfig string = 'default'
@description('Is the index prechunked')
param AzureSearchIndexIsPrechunked string = 'false'
@description('Top K results')
param AzureSearchTopK string = '5'
@description('Enable in domain')
param AzureSearchEnableInDomain string = 'false'
@description('Content columns')
param AzureSearchContentColumns string = 'content'
@description('Filename column')
param AzureSearchFilenameColumn string = 'filename'
@description('Title column')
param AzureSearchTitleColumn string = 'title'
@description('Url column')
param AzureSearchUrlColumn string = 'url'
@description('Name of Azure OpenAI Resource')
param AzureOpenAIResource string = '${ResourcePrefix}oai'
@description('Azure OpenAI GPT Model Deployment Name')
param AzureOpenAIGPTModel string = 'gpt-35-turbo'
@description('Azure OpenAI GPT Model Name')
param AzureOpenAIGPTModelName string = 'gpt-35-turbo'
@description('Azure OpenAI GPT Model Version')
param AzureOpenAIGPTModelVersion string = '0613'
@description('Azure OpenAI Embedding Model Deployment Name')
param AzureOpenAIEmbeddingModel string = 'text-embedding-ada-002'
@description('Azure OpenAI GPT Model Name')
param AzureOpenAIEmbeddingModelName string = 'text-embedding-ada-002'
@description('Azure OpenAI GPT Model Version')
param AzureOpenAIEmbeddingModelVersion string = '2'
@description('Orchestration strategy: openai_function or langchain str. If you use a old version of turbo (0301), plese select langchain')
@allowed([
'openai_function'
'langchain'
])
param OrchestrationStrategy string
@description('Azure OpenAI Temperature')
param AzureOpenAITemperature string = '0'
@description('Azure OpenAI Top P')
param AzureOpenAITopP string = '1'
@description('Azure OpenAI Max Tokens')
param AzureOpenAIMaxTokens string = '1000'
@description('Azure OpenAI Stop Sequence')
param AzureOpenAIStopSequence string = '\n'
@description('Azure OpenAI System Message')
param AzureOpenAISystemMessage string = 'You are an AI assistant that helps people find information.'
@description('Azure OpenAI Api Version')
param AzureOpenAIApiVersion string = '2023-07-01-preview'
@description('Whether or not to stream responses from Azure OpenAI')
param AzureOpenAIStream string = 'true'
@description('Azure AI Search Resource')
param AzureCognitiveSearch string = '${ResourcePrefix}-search'
@description('The SKU of the search service you want to create. E.g. free or standard')
@allowed([
'free'
'basic'
'standard'
'standard2'
'standard3'
])
param AzureCognitiveSearchSku string = 'standard'
@description('Azure AI Search Index')
param AzureSearchIndex string = '${ResourcePrefix}-index'
@description('Azure AI Search Conversation Log Index')
param AzureSearchConversationLogIndex string = 'conversations'
@description('Name of Storage Account')
param StorageAccountName string = '${ResourcePrefix}str'
@description('Name of Function App for Batch document processing')
param FunctionName string = '${ResourcePrefix}-backend'
@description('Azure Form Recognizer Name')
param FormRecognizerName string = '${ResourcePrefix}-formrecog'
@description('Azure Form Recognizer Location')
param FormRecognizerLocation string = Location
@description('Azure Speech Service Name')
param SpeechServiceName string = '${ResourcePrefix}-speechservice'
@description('Azure Content Safety Name')
param ContentSafetyName string = '${ResourcePrefix}-contentsafety'
param newGuidString string = newGuid()
var WebAppImageName = 'DOCKER|fruoccopublic.azurecr.io/rag-webapp'
var AdminWebAppImageName = 'DOCKER|fruoccopublic.azurecr.io/rag-adminwebapp'
var BackendImageName = 'DOCKER|fruoccopublic.azurecr.io/rag-backend'
var BlobContainerName = 'documents'
var QueueName = 'doc-processing'
var ClientKey = '${uniqueString(guid(resourceGroup().id, deployment().name))}${newGuidString}'
var EventGridSystemTopicName = 'doc-processing'
resource OpenAI 'Microsoft.CognitiveServices/accounts@2021-10-01' = {
name: AzureOpenAIResource
location: Location
kind: 'OpenAI'
sku: {
name: 'S0'
}
properties: {
customSubDomainName: AzureOpenAIResource
}
resource OpenAIGPTDeployment 'deployments@2023-05-01' = {
name: AzureOpenAIGPTModelName
properties: {
model: {
format: 'OpenAI'
name: AzureOpenAIGPTModel
version: AzureOpenAIGPTModelVersion
}
}
sku: {
name: 'Standard'
capacity: 30
}
}
resource OpenAIEmbeddingDeployment 'deployments@2023-05-01' = {
name: AzureOpenAIEmbeddingModelName
properties: {
model: {
format: 'OpenAI'
name: AzureOpenAIEmbeddingModel
version: AzureOpenAIEmbeddingModelVersion
}
}
sku: {
name: 'Standard'
capacity: 30
}
dependsOn: [
OpenAIGPTDeployment
]
}
}
resource AzureCognitiveSearch_resource 'Microsoft.Search/searchServices@2022-09-01' = {
name: AzureCognitiveSearch
location: Location
tags: {
deployment : 'chatwithyourdata-sa'
}
sku: {
name: AzureCognitiveSearchSku
}
properties: {
replicaCount: 1
partitionCount: 1
}
}
resource SpeechService 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
name: SpeechServiceName
location: Location
sku: {
name: 'S0'
}
kind: 'SpeechServices'
identity: {
type: 'None'
}
properties: {
networkAcls: {
defaultAction: 'Allow'
virtualNetworkRules: []
ipRules: []
}
publicNetworkAccess: 'Enabled'
}
}
resource FormRecognizer 'Microsoft.CognitiveServices/accounts@2022-12-01' = {
name: FormRecognizerName
location: FormRecognizerLocation
sku: {
name: 'S0'
}
kind: 'FormRecognizer'
identity: {
type: 'None'
}
properties: {
networkAcls: {
defaultAction: 'Allow'
virtualNetworkRules: []
ipRules: []
}
publicNetworkAccess: 'Enabled'
}
}
resource ContentSafety 'Microsoft.CognitiveServices/accounts@2022-03-01' = {
name: ContentSafetyName
location: Location
sku: {
name: 'S0'
}
kind: 'ContentSafety'
identity: {
type: 'None'
}
properties: {
networkAcls: {
defaultAction: 'Allow'
virtualNetworkRules: []
ipRules: []
}
}
}
resource HostingPlan 'Microsoft.Web/serverfarms@2020-06-01' = {
name: HostingPlanName
location: Location
sku: {
name: HostingPlanSku
}
properties: {
reserved: true
}
kind: 'linux'
}
resource Website 'Microsoft.Web/sites@2020-06-01' = {
name: WebsiteName
location: Location
properties: {
serverFarmId: HostingPlanName
siteConfig: {
appSettings: [
{ name: 'APPINSIGHTS_CONNECTION_STRING', value: reference(ApplicationInsights.id, '2015-05-01').ConnectionString}
{ name: 'AZURE_SEARCH_SERVICE', value: 'https://${AzureCognitiveSearch}.search.windows.net'}
{ name: 'AZURE_SEARCH_INDEX', value: AzureSearchIndex}
{ name: 'AZURE_SEARCH_CONVERSATIONS_LOG_INDEX', value: AzureSearchConversationLogIndex}
{ name: 'AZURE_SEARCH_KEY', value: listAdminKeys('Microsoft.Search/searchServices/${AzureCognitiveSearch}', '2021-04-01-preview').primaryKey}
{ name: 'AZURE_SEARCH_SEMANTIC_SEARCH_CONFIG', value: AzureSearchSemanticSearchConfig}
{ name: 'AZURE_SEARCH_INDEX_IS_PRECHUNKED', value: AzureSearchIndexIsPrechunked}
{ name: 'AZURE_SEARCH_TOP_K', value: AzureSearchTopK}
{ name: 'AZURE_SEARCH_ENABLE_IN_DOMAIN', value: AzureSearchEnableInDomain}
{ name: 'AZURE_SEARCH_CONTENT_COLUMNS', value: AzureSearchContentColumns}
{ name: 'AZURE_SEARCH_FILENAME_COLUMN', value: AzureSearchFilenameColumn}
{ name: 'AZURE_SEARCH_TITLE_COLUMN', value: AzureSearchTitleColumn}
{ name: 'AZURE_SEARCH_URL_COLUMN', value: AzureSearchUrlColumn}
{ name: 'AZURE_OPENAI_RESOURCE', value: AzureOpenAIResource}
{ name: 'AZURE_OPENAI_KEY', value: OpenAI.listKeys('2023-05-01').key1}
{ name: 'AZURE_OPENAI_MODEL', value: AzureOpenAIGPTModel}
{ name: 'AZURE_OPENAI_MODEL_NAME', value: AzureOpenAIGPTModelName}
{ name: 'AZURE_OPENAI_TEMPERATURE', value: AzureOpenAITemperature}
{ name: 'AZURE_OPENAI_TOP_P', value: AzureOpenAITopP}
{ name: 'AZURE_OPENAI_MAX_TOKENS', value: AzureOpenAIMaxTokens}
{ name: 'AZURE_OPENAI_STOP_SEQUENCE', value: AzureOpenAIStopSequence}
{ name: 'AZURE_OPENAI_SYSTEM_MESSAGE', value: AzureOpenAISystemMessage}
{ name: 'AZURE_OPENAI_API_VERSION', value: AzureOpenAIApiVersion}
{ name: 'AZURE_OPENAI_STREAM', value: AzureOpenAIStream}
{ name: 'AZURE_OPENAI_EMBEDDING_MODEL', value: AzureOpenAIEmbeddingModel}
{ name: 'AZURE_FORM_RECOGNIZER_ENDPOINT', value: 'https://${Location}.api.cognitive.microsoft.com/'}
{ name: 'AZURE_FORM_RECOGNIZER_KEY', value: listKeys('Microsoft.CognitiveServices/accounts/${FormRecognizerName}', '2023-05-01').key1}
{ name: 'AZURE_BLOB_ACCOUNT_NAME', value: StorageAccountName}
{ name: 'AZURE_BLOB_ACCOUNT_KEY', value: listKeys(StorageAccount.id, '2019-06-01').keys[0].value}
{ name: 'AZURE_BLOB_CONTAINER_NAME', value: BlobContainerName}
{ name: 'ORCHESTRATION_STRATEGY', value: OrchestrationStrategy}
{ name: 'AZURE_CONTENT_SAFETY_ENDPOINT', value: 'https://${Location}.api.cognitive.microsoft.com/'}
{ name: 'AZURE_CONTENT_SAFETY_KEY', value: listKeys('Microsoft.CognitiveServices/accounts/${ContentSafetyName}', '2023-05-01').key1}
{ name: 'AZURE_SPEECH_SERVICE_NAME', value: SpeechServiceName}
{ name: 'AZURE_SPEECH_SERVICE_KEY', value: listKeys('Microsoft.CognitiveServices/accounts/${SpeechServiceName}', '2023-05-01').key1}
{ name: 'AZURE_SPEECH_SERVICE_REGION', value: Location}
]
linuxFxVersion: WebAppImageName
}
}
dependsOn: [
HostingPlan
]
}
resource WebsiteName_admin 'Microsoft.Web/sites@2020-06-01' = {
name: '${WebsiteName}-admin'
location: Location
properties: {
serverFarmId: HostingPlanName
siteConfig: {
appSettings: [
{ name: 'APPINSIGHTS_INSTRUMENTATIONKEY', value: reference(ApplicationInsights.id, '2015-05-01').InstrumentationKey }
{ name: 'AZURE_SEARCH_SERVICE', value: 'https://${AzureCognitiveSearch}.search.windows.net' }
{ name: 'AZURE_SEARCH_KEY', value: listAdminKeys('Microsoft.Search/searchServices/${AzureCognitiveSearch}', '2021-04-01-preview').primaryKey }
{ name: 'AZURE_SEARCH_INDEX', value: AzureSearchIndex }
{ name: 'AZURE_SEARCH_USE_SEMANTIC_SEARCH', value: AzureSearchUseSemanticSearch }
{ name: 'AZURE_SEARCH_SEMANTIC_SEARCH_CONFIG', value: AzureSearchSemanticSearchConfig }
{ name: 'AZURE_SEARCH_INDEX_IS_PRECHUNKED', value: AzureSearchIndexIsPrechunked }
{ name: 'AZURE_SEARCH_TOP_K', value: AzureSearchTopK }
{ name: 'AZURE_SEARCH_ENABLE_IN_DOMAIN', value: AzureSearchEnableInDomain }
{ name: 'AZURE_SEARCH_CONTENT_COLUMNS', value: AzureSearchContentColumns}
{ name: 'AZURE_SEARCH_FILENAME_COLUMN', value: AzureSearchFilenameColumn }
{ name: 'AZURE_SEARCH_TITLE_COLUMN', value: AzureSearchTitleColumn}
{ name: 'AZURE_SEARCH_URL_COLUMN', value: AzureSearchUrlColumn }
{ name: 'AZURE_OPENAI_RESOURCE', value: AzureOpenAIResource}
{ name: 'AZURE_OPENAI_KEY', value: OpenAI.listKeys('2023-05-01').key1}
{ name: 'AZURE_OPENAI_MODEL', value: AzureOpenAIGPTModel }
{ name: 'AZURE_OPENAI_MODEL_NAME', value: AzureOpenAIGPTModelName }
{ name: 'AZURE_OPENAI_TEMPERATURE', value: AzureOpenAITemperature }
{ name: 'AZURE_OPENAI_TOP_P', value: AzureOpenAITopP }
{ name: 'AZURE_OPENAI_MAX_TOKENS', value: AzureOpenAIMaxTokens }
{ name: 'AZURE_OPENAI_STOP_SEQUENCE', value: AzureOpenAIStopSequence }
{ name: 'AZURE_OPENAI_SYSTEM_MESSAGE', value: AzureOpenAISystemMessage }
{ name: 'AZURE_OPENAI_API_VERSION', value: AzureOpenAIApiVersion }
{ name: 'AZURE_OPENAI_STREAM', value: AzureOpenAIStream }
{ name: 'AZURE_OPENAI_EMBEDDING_MODEL', value: AzureOpenAIEmbeddingModel }
{ name: 'AZURE_FORM_RECOGNIZER_ENDPOINT', value: 'https://${Location}.api.cognitive.microsoft.com/' }
{ name: 'AZURE_FORM_RECOGNIZER_KEY', value: listKeys('Microsoft.CognitiveServices/accounts/${FormRecognizerName}', '2023-05-01').key1 }
{ name: 'AZURE_BLOB_ACCOUNT_NAME', value: StorageAccountName }
{ name: 'AZURE_BLOB_ACCOUNT_KEY', value: listKeys(StorageAccount.id, '2019-06-01').keys[0].value }
{ name: 'AZURE_BLOB_CONTAINER_NAME', value: BlobContainerName }
{ name: 'DOCUMENT_PROCESSING_QUEUE_NAME', value: QueueName}
{ name: 'BACKEND_URL', value: 'https://${FunctionName}.azurewebsites.net'}
{ name: 'FUNCTION_KEY', value: ClientKey}
{ name: 'ORCHESTRATION_STRATEGY', value: OrchestrationStrategy}
{ name: 'AZURE_CONTENT_SAFETY_ENDPOINT', value: 'https://${Location}.api.cognitive.microsoft.com/'}
{ name: 'AZURE_CONTENT_SAFETY_KEY', value: listKeys('Microsoft.CognitiveServices/accounts/${ContentSafetyName}', '2023-05-01').key1}
]
linuxFxVersion: AdminWebAppImageName
}
}
dependsOn: [
HostingPlan
]
}
resource StorageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = {
name: StorageAccountName
location: Location
kind: 'StorageV2'
sku: {
name: 'Standard_GRS'
}
}
resource StorageAccountName_default_BlobContainer 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-08-01' = {
name: '${StorageAccountName}/default/${BlobContainerName}'
properties: {
publicAccess: 'None'
}
dependsOn: [
StorageAccount
]
}
resource StorageAccountName_default_config 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-08-01' = {
name: '${StorageAccountName}/default/config'
properties: {
publicAccess: 'None'
}
dependsOn: [
StorageAccount
]
}
resource StorageAccountName_default 'Microsoft.Storage/storageAccounts/queueServices@2022-09-01' = {
parent: StorageAccount
name: 'default'
properties: {
cors: {
corsRules: []
}
}
}
resource StorageAccountName_default_doc_processing 'Microsoft.Storage/storageAccounts/queueServices/queues@2022-09-01' = {
parent: StorageAccountName_default
name: 'doc-processing'
properties: {
metadata: {}
}
dependsOn: []
}
resource StorageAccountName_default_doc_processing_poison 'Microsoft.Storage/storageAccounts/queueServices/queues@2022-09-01' = {
parent: StorageAccountName_default
name: 'doc-processing-poison'
properties: {
metadata: {}
}
dependsOn: []
}
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-06-01' = {
name: logAnalyticsWorkspaceName
location: Location
properties: {
sku: {
name: 'pergb2018'
}
}
}
resource ApplicationInsights 'Microsoft.Insights/components@2020-02-02' = {
name: ApplicationInsightsName
location: Location
tags: {
'hidden-link:${resourceId('Microsoft.Web/sites', ApplicationInsightsName)}': 'Resource'
}
properties: {
Application_Type: 'web'
WorkspaceResourceId: logAnalyticsWorkspace.id
}
kind: 'web'
}
resource Function 'Microsoft.Web/sites@2018-11-01' = {
name: FunctionName
kind: 'functionapp,linux'
location: Location
tags: {}
properties: {
siteConfig: {
appSettings: [
{ name: 'FUNCTIONS_EXTENSION_VERSION', value: '~4'}
{ name: 'WEBSITES_ENABLE_APP_SERVICE_STORAGE', value: 'false'}
{ name: 'APPINSIGHTS_INSTRUMENTATIONKEY', value: reference(ApplicationInsights.id, '2015-05-01').InstrumentationKey}
{ name: 'AzureWebJobsStorage', value: 'DefaultEndpointsProtocol=https;AccountName=${StorageAccountName};AccountKey=${listKeys(StorageAccount.id, '2019-06-01').keys[0].value};EndpointSuffix=core.windows.net'}
{ name: 'AZURE_OPENAI_MODEL', value: AzureOpenAIGPTModel}
{ name: 'AZURE_OPENAI_EMBEDDING_MODEL', value: AzureOpenAIEmbeddingModel}
{ name: 'AZURE_OPENAI_RESOURCE', value: AzureOpenAIResource}
{ name: 'AZURE_OPENAI_KEY', value: OpenAI.listKeys('2023-05-01').key1}
{ name: 'AZURE_BLOB_ACCOUNT_NAME', value: StorageAccountName}
{ name: 'AZURE_BLOB_ACCOUNT_KEY', value: listKeys(StorageAccount.id, '2019-06-01').keys[0].value}
{ name: 'AZURE_BLOB_CONTAINER_NAME', value: BlobContainerName}
{ name: 'AZURE_FORM_RECOGNIZER_ENDPOINT', value: 'https://${Location}.api.cognitive.microsoft.com/'}
{ name: 'AZURE_FORM_RECOGNIZER_KEY', value: listKeys('Microsoft.CognitiveServices/accounts/${FormRecognizerName}', '2023-05-01').key1}
{ name: 'AZURE_SEARCH_SERVICE', value: 'https://${AzureCognitiveSearch}.search.windows.net'}
{ name: 'AZURE_SEARCH_KEY', value: listAdminKeys('Microsoft.Search/searchServices/${AzureCognitiveSearch}', '2021-04-01-preview').primaryKey}
{ name: 'DOCUMENT_PROCESSING_QUEUE_NAME', value: QueueName}
{ name: 'AZURE_OPENAI_API_VERSION', value: AzureOpenAIApiVersion}
{ name: 'AZURE_SEARCH_INDEX', value: AzureSearchIndex}
{ name: 'ORCHESTRATION_STRATEGY', value: OrchestrationStrategy}
{ name: 'AZURE_CONTENT_SAFETY_ENDPOINT', value: 'https://${Location}.api.cognitive.microsoft.com/'}
{ name: 'AZURE_CONTENT_SAFETY_KEY', value: listKeys('Microsoft.CognitiveServices/accounts/${ContentSafetyName}', '2023-05-01').key1}
]
cors: {
allowedOrigins: [
'https://portal.azure.com'
]
}
use32BitWorkerProcess: false
linuxFxVersion: BackendImageName
appCommandLine: ''
alwaysOn: true
}
serverFarmId: HostingPlan.id
clientAffinityEnabled: false
httpsOnly: true
}
}
resource FunctionName_default_clientKey 'Microsoft.Web/sites/host/functionKeys@2018-11-01' = {
name: '${FunctionName}/default/clientKey'
properties: {
name: 'ClientKey'
value: ClientKey
}
dependsOn: [
Function
WaitFunctionDeploymentSection
]
}
resource WaitFunctionDeploymentSection 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
kind: 'AzurePowerShell'
name: 'WaitFunctionDeploymentSection'
location: Location
properties: {
azPowerShellVersion: '3.0'
scriptContent: 'start-sleep -Seconds 300'
cleanupPreference: 'Always'
retentionInterval: 'PT1H'
}
dependsOn: [
Function
]
}
resource EventGridSystemTopic 'Microsoft.EventGrid/systemTopics@2021-12-01' = {
name: EventGridSystemTopicName
location: Location
properties: {
source: StorageAccount.id
topicType: 'Microsoft.Storage.StorageAccounts'
}
}
resource EventGridSystemTopicName_BlobEvents 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2021-12-01' = {
parent: EventGridSystemTopic
name: 'BlobEvents'
properties: {
destination: {
endpointType: 'StorageQueue'
properties: {
queueMessageTimeToLiveInSeconds: -1
queueName: StorageAccountName_default_doc_processing.name
resourceId: StorageAccount.id
}
}
filter: {
includedEventTypes: [
'Microsoft.Storage.BlobCreated'
'Microsoft.Storage.BlobDeleted'
]
enableAdvancedFilteringOnArrays: true
subjectBeginsWith: '/blobServices/default/containers/${BlobContainerName}/blobs/'
}
labels: []
eventDeliverySchema: 'EventGridSchema'
retryPolicy: {
maxDeliveryAttempts: 30
eventTimeToLiveInMinutes: 1440
}
}
}