-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.bicep
612 lines (552 loc) · 22.7 KB
/
main.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
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
targetScope = 'subscription'
@minLength(1)
@maxLength(64)
@description('Name of the the environment which is used to generate a short unique hash used in all resources.')
param environmentName string
@minLength(1)
@description('Primary location for all resources (filtered on available regions for Azure Open AI Service).')
@allowed([ 'westeurope', 'southcentralus', 'australiaeast', 'canadaeast', 'eastus', 'eastus2', 'francecentral', 'japaneast', 'northcentralus', 'swedencentral', 'switzerlandnorth', 'uksouth' ])
param location string
//Leave blank to use default naming conventions
@description('Name of the resource group. Leave blank to use default naming conventions.')
param resourceGroupName string = ''
@description('Name of the identity. Leave blank to use default naming conventions.')
param identityName string = ''
@description('Name of the API Management service. Leave blank to use default naming conventions.')
param apimServiceName string = ''
@description('Network type for API Management service. Leave blank to use default naming conventions.')
@allowed([ 'None', 'External', 'Internal' ])
param apimNetworkType string = 'External'
@description('Azure OpenAI service public access')
@allowed([ 'Enabled', 'Disabled' ])
param openAIExternalNetworkAccess string = 'Disabled'
@description('Name of the Log Analytics workspace. Leave blank to use default naming conventions.')
param logAnalyticsName string = ''
@description('Create Application Insights dashboard. Turn it on only if you need it.')
param createAppInsightsDashboard bool = false
@description('Name of the Application Insights dashboard. Leave blank to use default naming conventions.')
param applicationInsightsDashboardName string = ''
@description('Name of the Application Insights dashboard. Leave blank to use default naming conventions.')
param funcAplicationInsightsDashboardName string = ''
@description('Name of the Application Insights for APIM resource. Leave blank to use default naming conventions.')
param applicationInsightsName string = ''
@description('Name of the Application Insights for Function App resource. Leave blank to use default naming conventions.')
param funcApplicationInsightsName string = ''
@description('Name of the Event Hub Namespace resource. Leave blank to use default naming conventions.')
param eventHubNamespaceName string = ''
@description('Name of the Cosmos Db account resource. Leave blank to use default naming conventions.')
param cosmosDbAccountName string = ''
@description('Name of the Stream Analytics resource. Leave blank to use default naming conventions.')
param streamAnalyticsJobName string = ''
@description('Flag to create Azure Function App. Turn it on only if you need it.')
param provisionFunctionApp bool = false
@description('Name of the Function App resource. Leave blank to use default naming conventions.')
param usageProcessingFunctionAppName string = ''
@description('Name of the Function App resource. Leave blank to use default naming conventions.')
param storageAccountName string = ''
@description('Name of the Storage Account file share used by Azure Function')
param functionContentShareName string = 'usage-function-content'
@description('Name of the Storage Account file share used by Azure Function')
param logicContentShareName string = 'usage-logic-content'
@description('Provision stream analytics job, turn it on only if you need it. Azure Function App will be provisioned to process usage data from Event Hub.')
param provisionStreamAnalytics bool = false
//Networking - VNet
param useExistingVnet bool = false
param existingVnetRG string = ''
param vnetName string = ''
param apimSubnetName string = ''
param privateEndpointSubnetName string = ''
param functionAppSubnetName string = ''
param apimNsgName string = ''
param privateEndpointNsgName string = ''
param functionAppNsgName string = ''
// Networking - Address Space
param vnetAddressPrefix string = '10.170.0.0/24'
param apimSubnetPrefix string = '10.170.0.0/26'
param privateEndpointSubnetPrefix string = '10.170.0.64/26'
param functionAppSubnetPrefix string = '10.170.0.128/26'
// Networking - Private DNS
param dnsZoneRG string = ''
param dnsSubscriptionId string = ''
var openAiPrivateDnsZoneName = 'privatelink.openai.azure.com'
var keyVaultPrivateDnsZoneName = 'privatelink.vaultcore.azure.net'
var monitorPrivateDnsZoneName = 'privatelink.monitor.azure.com'
var eventHubPrivateDnsZoneName = 'privatelink.servicebus.windows.net'
var cosmosDbPrivateDnsZoneName = 'privatelink.documents.azure.com'
var storageBlobPrivateDnsZoneName = 'privatelink.blob.core.windows.net'
var storageFilePrivateDnsZoneName = 'privatelink.file.core.windows.net'
var storageTablePrivateDnsZoneName = 'privatelink.table.core.windows.net'
var storageQueuePrivateDnsZoneName = 'privatelink.queue.core.windows.net'
var privateDnsZoneNames = [
openAiPrivateDnsZoneName
keyVaultPrivateDnsZoneName
monitorPrivateDnsZoneName
eventHubPrivateDnsZoneName
cosmosDbPrivateDnsZoneName
storageBlobPrivateDnsZoneName
storageFilePrivateDnsZoneName
storageTablePrivateDnsZoneName
storageQueuePrivateDnsZoneName
]
// You can add more OpenAI instances by adding more objects to the openAiInstances object
// Then update the apim policy xml to include the new instances
@description('Object containing OpenAI instances. You can add more instances by adding more objects to this parameter.')
param openAiInstances object = {
openAi1: {
name: 'openai1'
location: 'eastus'
deployments: [
{
name: chatGptDeploymentName
model: {
format: 'OpenAI'
name: chatGptModelName
version: chatGptModelVersion
}
scaleSettings: {
scaleType: 'Standard'
}
}
{
name: embeddingGptDeploymentName
model: {
format: 'OpenAI'
name: embeddingGptModelName
version: embeddingGptModelVersion
}
sku: {
name: 'Standard'
capacity: deploymentCapacity
}
}
{
name: 'gpt-4o'
model: {
format: 'OpenAI'
name: 'gpt-4o'
version: '2024-05-13'
}
sku: {
name: 'GlobalStandard'
capacity: deploymentCapacity
}
}
{
name: 'dall-e-3'
location: 'eastus'
model: {
format: 'OpenAI'
name: 'dall-e-3'
version: '3.0'
}
sku: {
name: 'Standard'
capacity: 1
}
}
]
}
openAi2: {
name: 'openai2'
location: 'northcentralus'
deployments: [
{
name: chatGptDeploymentName
model: {
format: 'OpenAI'
name: chatGptModelName
version: chatGptModelVersion
}
scaleSettings: {
scaleType: 'Standard'
}
}
{
name: embeddingGptDeploymentName
model: {
format: 'OpenAI'
name: embeddingGptModelName
version: embeddingGptModelVersion
}
sku: {
name: 'Standard'
capacity: deploymentCapacity
}
}
]
}
openAi3: {
name: 'openai3'
location: 'eastus2'
deployments: [
{
name: chatGptDeploymentName
model: {
format: 'OpenAI'
name: chatGptModelName
version: chatGptModelVersion
}
scaleSettings: {
scaleType: 'Standard'
}
}
{
name: embeddingGptDeploymentName
model: {
format: 'OpenAI'
name: embeddingGptModelName
version: embeddingGptModelVersion
}
sku: {
name: 'Standard'
capacity: deploymentCapacity
}
}
]
}
}
param enableAzureAISearch bool = true
@description('Object containing AI Search existing instances. You can add more instances by adding more objects to this parameter.')
param aiSearchInstances array = [
{
name: 'ai-search-swn'
url: 'https://REPLACE1.search.windows.net/'
description: 'AI Search Instance 1'
}
{
name: 'ai-search-sec'
url: 'https://REPLACE2.search.windows.net/'
description: 'AI Search Instance 2'
}
]
@description('SKU name for OpenAI.')
param openAiSkuName string = 'S0'
@description('Version of the Chat GPT model.')
param chatGptModelVersion string = '0613'
@description('Name of the Chat GPT deployment.')
param chatGptDeploymentName string = 'chat'
@description('Name of the Chat GPT model.')
param chatGptModelName string = 'gpt-35-turbo'
@description('Name of the embedding model.')
param embeddingGptModelName string = 'text-embedding-ada-002'
@description('Version of the embedding model.')
param embeddingGptModelVersion string = '2'
@description('Name of the embedding deployment.')
param embeddingGptDeploymentName string = 'embedding'
@description('The OpenAI endpoints capacity (in thousands of tokens per minute)')
param deploymentCapacity int = 20
@description('Tags to be applied to resources.')
param tags object = { 'azd-env-name': environmentName }
@description('Should Entra ID validation be enabled')
param entraAuth bool = false
param entraTenantId string = ''
param entraClientId string = ''
param entraAudience string = ''
param usageProcessingLogicAppName string = ''
// Load abbreviations from JSON file
var abbrs = loadJsonContent('./abbreviations.json')
// Generate a unique token for resources
var resourceToken = toLower(uniqueString(subscription().id, environmentName, location))
// Organize resources in a resource group
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: !empty(resourceGroupName) ? resourceGroupName : '${abbrs.resourcesResourceGroups}${environmentName}'
location: location
tags: tags
}
module dnsDeployment './modules/networking/dns.bicep' = [for privateDnsZoneName in privateDnsZoneNames: {
name: 'dns-deployment-${privateDnsZoneName}'
scope: resourceGroup
params: {
name: privateDnsZoneName
}
}]
module vnet './modules/networking/vnet.bicep' = if(!useExistingVnet) {
name: 'vnet'
scope: resourceGroup
params: {
name: !empty(vnetName) ? vnetName : 'vnet-${resourceToken}'
apimSubnetName: !empty(apimSubnetName) ? apimSubnetName : 'snet-apim'
apimNsgName: !empty(apimNsgName) ? apimNsgName : 'nsg-apim-${resourceToken}'
privateEndpointSubnetName: !empty(privateEndpointSubnetName) ? privateEndpointSubnetName : 'snet-private-endpoint'
privateEndpointNsgName: !empty(privateEndpointNsgName) ? privateEndpointNsgName : 'nsg-pe-${resourceToken}'
functionAppSubnetName: !empty(functionAppSubnetName) ? functionAppSubnetName : 'snet-functionapp'
functionAppNsgName: !empty(functionAppNsgName) ? functionAppNsgName : 'nsg-functionapp-${resourceToken}'
vnetAddressPrefix: vnetAddressPrefix
apimSubnetAddressPrefix: apimSubnetPrefix
privateEndpointSubnetAddressPrefix: privateEndpointSubnetPrefix
functionAppSubnetAddressPrefix: functionAppSubnetPrefix
location: location
tags: tags
privateDnsZoneNames: privateDnsZoneNames
apimRouteTableName: 'rt-apim-${resourceToken}'
}
dependsOn: [
dnsDeployment
]
}
module vnetExisting './modules/networking/vnet-existing.bicep' = if(useExistingVnet) {
name: 'vnetExisting'
scope: resourceGroup
params: {
name: vnetName
apimSubnetName: !empty(apimSubnetName) ? apimSubnetName : 'snet-apim'
privateEndpointSubnetName: !empty(privateEndpointSubnetName) ? privateEndpointSubnetName : 'snet-private-endpoint'
functionAppSubnetName: !empty(functionAppSubnetName) ? functionAppSubnetName : 'snet-functionapp'
vnetRG: existingVnetRG
}
dependsOn: [
dnsDeployment
]
}
module apimManagedIdentity './modules/security/managed-identity-apim.bicep' = {
name: 'apim-managed-identity'
scope: resourceGroup
params: {
name: !empty(identityName) ? identityName : '${abbrs.managedIdentityUserAssignedIdentities}apim-${resourceToken}'
location: location
tags: tags
}
}
module usageManagedIdentity './modules/security/managed-identity-stream-analytics.bicep' = {
name: 'usage-managed-identity'
scope: resourceGroup
params: {
name: !empty(identityName) ? identityName : '${abbrs.managedIdentityUserAssignedIdentities}usage-${resourceToken}'
location: location
tags: tags
cosmosDbAccountName: cosmosDb.outputs.cosmosDbAccountName
}
}
module monitoring './modules/monitor/monitoring.bicep' = {
name: 'monitoring'
scope: resourceGroup
params: {
location: location
tags: tags
logAnalyticsName: !empty(logAnalyticsName) ? logAnalyticsName : '${abbrs.operationalInsightsWorkspaces}${resourceToken}'
apimApplicationInsightsName: !empty(applicationInsightsName) ? applicationInsightsName : '${abbrs.insightsComponents}apim-${resourceToken}'
apimApplicationInsightsDashboardName: !empty(applicationInsightsDashboardName) ? applicationInsightsDashboardName : '${abbrs.portalDashboards}apim-${resourceToken}'
functionApplicationInsightsName: !empty(funcApplicationInsightsName) ? funcApplicationInsightsName : '${abbrs.insightsComponents}func-${resourceToken}'
functionApplicationInsightsDashboardName: !empty(funcAplicationInsightsDashboardName) ? funcAplicationInsightsDashboardName : '${abbrs.portalDashboards}func-${resourceToken}'
vNetName: useExistingVnet ? vnetExisting.outputs.vnetName : vnet.outputs.vnetName
vNetRG: useExistingVnet ? vnetExisting.outputs.vnetRG : vnet.outputs.vnetRG
privateEndpointSubnetName: useExistingVnet ? vnetExisting.outputs.privateEndpointSubnetName : vnet.outputs.privateEndpointSubnetName
applicationInsightsDnsZoneName: monitorPrivateDnsZoneName
createDashboard: createAppInsightsDashboard
dnsZoneRG: !empty(dnsZoneRG) ? dnsZoneRG : resourceGroup.name
dnsSubscriptionId: !empty(dnsSubscriptionId) ? dnsSubscriptionId : subscription().subscriptionId
}
dependsOn: [
vnet
vnetExisting
]
}
@batchSize(1)
module openAis 'modules/ai/cognitiveservices.bicep' = [for (config, i) in items(openAiInstances): {
name: '${config.value.name}-${resourceToken}'
scope: resourceGroup
params: {
name: '${config.value.name}-${resourceToken}'
location: config.value.location
tags: tags
managedIdentityName: apimManagedIdentity.outputs.managedIdentityName
vNetName: useExistingVnet ? vnetExisting.outputs.vnetName : vnet.outputs.vnetName
vNetLocation: useExistingVnet ? vnetExisting.outputs.location : vnet.outputs.location
privateEndpointSubnetName: useExistingVnet ? vnetExisting.outputs.privateEndpointSubnetName : vnet.outputs.privateEndpointSubnetName
openAiPrivateEndpointName: '${config.value.name}-pe-${resourceToken}'
publicNetworkAccess: openAIExternalNetworkAccess
openAiDnsZoneName: openAiPrivateDnsZoneName
sku: {
name: openAiSkuName
}
deploymentCapacity: deploymentCapacity
deployments: config.value.deployments
vNetRG: useExistingVnet ? vnetExisting.outputs.vnetRG : vnet.outputs.vnetRG
dnsZoneRG: !empty(dnsZoneRG) ? dnsZoneRG : resourceGroup.name
dnsSubscriptionId: !empty(dnsSubscriptionId) ? dnsSubscriptionId : subscription().subscriptionId
}
dependsOn: [
vnet
vnetExisting
apimManagedIdentity
]
}]
module eventHub './modules/event-hub/event-hub.bicep' = {
name: 'event-hub'
scope: resourceGroup
params: {
name: !empty(eventHubNamespaceName) ? eventHubNamespaceName : '${abbrs.eventHubNamespaces}${resourceToken}'
location: location
tags: tags
eventHubPrivateEndpointName: 'eh-pe-${resourceToken}'
vNetName: useExistingVnet ? vnetExisting.outputs.vnetName : vnet.outputs.vnetName
privateEndpointSubnetName: useExistingVnet ? vnetExisting.outputs.privateEndpointSubnetName : vnet.outputs.privateEndpointSubnetName
eventHubDnsZoneName: eventHubPrivateDnsZoneName
vNetRG: useExistingVnet ? vnetExisting.outputs.vnetRG : vnet.outputs.vnetRG
dnsZoneRG: !empty(dnsZoneRG) ? dnsZoneRG : resourceGroup.name
dnsSubscriptionId: !empty(dnsSubscriptionId) ? dnsSubscriptionId : subscription().subscriptionId
}
dependsOn: [
vnet
vnetExisting
]
}
module apim './modules/apim/apim.bicep' = {
name: 'apim'
scope: resourceGroup
params: {
name: !empty(apimServiceName) ? apimServiceName : '${abbrs.apiManagementService}${resourceToken}'
location: location
tags: tags
applicationInsightsName: monitoring.outputs.applicationInsightsName
openAiUris: [for i in range(0, length(openAiInstances)): openAis[i].outputs.openAiEndpointUri]
managedIdentityName: apimManagedIdentity.outputs.managedIdentityName
entraAuth: entraAuth
clientAppId: entraAuth ? entraClientId : null
tenantId: entraAuth ? entraTenantId : null
audience: entraAuth ? entraAudience : null
eventHubName: eventHub.outputs.eventHubName
eventHubEndpoint: eventHub.outputs.eventHubEndpoint
apimSubnetId: useExistingVnet ? vnetExisting.outputs.apimSubnetId : vnet.outputs.apimSubnetId
apimNetworkType: apimNetworkType
enableAzureAISearch: enableAzureAISearch
aiSearchInstances: aiSearchInstances
}
dependsOn: [
vnet
vnetExisting
apimManagedIdentity
eventHub
]
}
module cosmosDb './modules/cosmos-db/cosmos-db.bicep' = {
name: 'cosmos-db'
scope: resourceGroup
params: {
accountName: !empty(cosmosDbAccountName) ? cosmosDbAccountName : '${abbrs.documentDBDatabaseAccounts}${resourceToken}'
location: location
tags: tags
vNetName: useExistingVnet ? vnetExisting.outputs.vnetName : vnet.outputs.vnetName
cosmosDnsZoneName: cosmosDbPrivateDnsZoneName
cosmosPrivateEndpointName: '${abbrs.documentDBDatabaseAccounts}pe-${resourceToken}'
privateEndpointSubnetName: useExistingVnet ? vnetExisting.outputs.privateEndpointSubnetName : vnet.outputs.privateEndpointSubnetName
vNetRG: useExistingVnet ? vnetExisting.outputs.vnetRG : vnet.outputs.vnetRG
dnsZoneRG: !empty(dnsZoneRG) ? dnsZoneRG : resourceGroup.name
dnsSubscriptionId: !empty(dnsSubscriptionId) ? dnsSubscriptionId : subscription().subscriptionId
}
dependsOn: [
vnet
vnetExisting
]
}
module streamAnalyticsJob './modules/stream-analytics/stream-analytics.bicep' = if(provisionStreamAnalytics) {
name: 'stream-analytics-job'
scope: resourceGroup
params: {
jobName: !empty(streamAnalyticsJobName) ? streamAnalyticsJobName : '${abbrs.streamAnalyticsCluster}${resourceToken}'
location: location
tags: tags
eventHubNamespace: eventHub.outputs.eventHubNamespaceName
eventHubName: eventHub.outputs.eventHubName
cosmosDbAccountName: cosmosDb.outputs.cosmosDbAccountName
cosmosDbDatabaseName: cosmosDb.outputs.cosmosDbDatabaseName
cosmosDbContainerName: cosmosDb.outputs.cosmosDbContainerName
managedIdentityName: usageManagedIdentity.outputs.managedIdentityName
}
}
module storageAccount './modules/functionapp/storageaccount.bicep' = {
name: 'storage'
scope: resourceGroup
params: {
location: location
tags: tags
storageAccountName: !empty(storageAccountName) ? storageAccountName : 'funcusage${resourceToken}'
functionAppManagedIdentityName: usageManagedIdentity.outputs.managedIdentityName
vNetName: useExistingVnet ? vnetExisting.outputs.vnetName : vnet.outputs.vnetName
privateEndpointSubnetName: useExistingVnet ? vnetExisting.outputs.privateEndpointSubnetName : vnet.outputs.privateEndpointSubnetName
storageBlobDnsZoneName: storageBlobPrivateDnsZoneName
storageFileDnsZoneName: storageFilePrivateDnsZoneName
storageTableDnsZoneName: storageTablePrivateDnsZoneName
storageQueueDnsZoneName: storageQueuePrivateDnsZoneName
storageBlobPrivateEndpointName: '${abbrs.storageStorageAccounts}blob-pe-${resourceToken}'
storageFilePrivateEndpointName: '${abbrs.storageStorageAccounts}file-pe-${resourceToken}'
storageTablePrivateEndpointName: '${abbrs.storageStorageAccounts}table-pe-${resourceToken}'
storageQueuePrivateEndpointName: '${abbrs.storageStorageAccounts}queue-pe-${resourceToken}'
functionContentShareName: functionContentShareName
logicContentShareName: logicContentShareName
vNetRG: useExistingVnet ? vnetExisting.outputs.vnetRG : vnet.outputs.vnetRG
dnsZoneRG: !empty(dnsZoneRG) ? dnsZoneRG : resourceGroup.name
dnsSubscriptionId: !empty(dnsSubscriptionId) ? dnsSubscriptionId : subscription().subscriptionId
}
dependsOn: [
vnet
vnetExisting
]
}
module functionApp './modules/functionapp/functionapp.bicep' = if(provisionFunctionApp) {
name: 'usageFunctionApp'
scope: resourceGroup
params: {
location: location
tags: tags
functionAppName: !empty(usageProcessingFunctionAppName) ? usageProcessingFunctionAppName : '${abbrs.webSitesFunctions}usage-${resourceToken}'
azdserviceName: 'usageProcessingFunctionApp'
storageAccountName: storageAccount.outputs.storageAccountName
functionAppIdentityName: usageManagedIdentity.outputs.managedIdentityName
applicationInsightsName: monitoring.outputs.funcApplicationInsightsName
eventHubNamespaceName: eventHub.outputs.eventHubNamespaceName
eventHubName: eventHub.outputs.eventHubName
cosmosDBEndpoint: cosmosDb.outputs.cosmosDbEndpoint
cosmosDatabaseName: cosmosDb.outputs.cosmosDbDatabaseName
cosmosContainerName: cosmosDb.outputs.cosmosDbContainerName
functionAppSubnetId: useExistingVnet ? vnetExisting.outputs.functionAppSubnetId : vnet.outputs.functionAppSubnetId
functionContentShareName: functionContentShareName
}
dependsOn: [
vnet
vnetExisting
storageAccount
usageManagedIdentity
monitoring
eventHub
cosmosDb
]
}
module logicApp './modules/logicapp/logicapp.bicep' = {
name: 'usageLogicApp'
scope: resourceGroup
params: {
location: location
tags: tags
logicAppName: !empty(usageProcessingLogicAppName) ? usageProcessingLogicAppName : '${abbrs.logicWorkflows}usage-${resourceToken}'
azdserviceName: 'usageProcessingLogicApp'
storageAccountName: storageAccount.outputs.storageAccountName
applicationInsightsName: monitoring.outputs.funcApplicationInsightsName
skuFamily: 'WS'
skuName: 'WS1'
skuCapaicty: 1
skuSize: 'WS1'
skuTier: 'WorkflowStandard'
isReserved: false
cosmosDbAccountName: cosmosDb.outputs.cosmosDbAccountName
eventHubName: eventHub.outputs.eventHubName
eventHubNamespaceName: eventHub.outputs.eventHubNamespaceName
cosmosDBDatabaseName: cosmosDb.outputs.cosmosDbDatabaseName
cosmosDBContainerConfigName: cosmosDb.outputs.cosmosDbStreamingExportConfigContainerName
cosmosDBContainerUsageName: cosmosDb.outputs.cosmosDbContainerName
apimAppInsightsName: monitoring.outputs.applicationInsightsName
functionAppSubnetId: useExistingVnet ? vnetExisting.outputs.functionAppSubnetId : vnet.outputs.functionAppSubnetId
fileShareName: logicContentShareName
}
dependsOn: [
vnet
vnetExisting
storageAccount
monitoring
eventHub
cosmosDb
]
}
output APIM_NAME string = apim.outputs.apimName
output APIM_AOI_PATH string = apim.outputs.apimOpenaiApiPath
output APIM_GATEWAY_URL string = apim.outputs.apimGatewayUrl