@@ -21,13 +21,15 @@ param searchServiceName string = '' // Set in main.parameters.json
21
21
param searchServiceResourceGroupName string = '' // Set in main.parameters.json
22
22
param searchServiceLocation string = '' // Set in main.parameters.json
23
23
// The free tier does not support managed identity (required) or semantic search (optional)
24
- @allowed ([ 'free' , 'basic' , 'standard' , 'standard2' , 'standard3' , 'storage_optimized_l1' , 'storage_optimized_l2' ])
24
+ @allowed (['free' , 'basic' , 'standard' , 'standard2' , 'standard3' , 'storage_optimized_l1' , 'storage_optimized_l2' ])
25
25
param searchServiceSkuName string // Set in main.parameters.json
26
26
param searchIndexName string // Set in main.parameters.json
27
27
param searchQueryLanguage string // Set in main.parameters.json
28
28
param searchQuerySpeller string // Set in main.parameters.json
29
29
param searchServiceSemanticRankerLevel string // Set in main.parameters.json
30
- var actualSearchServiceSemanticRankerLevel = (searchServiceSkuName == 'free' ) ? 'disabled' : searchServiceSemanticRankerLevel
30
+ var actualSearchServiceSemanticRankerLevel = (searchServiceSkuName == 'free' )
31
+ ? 'disabled'
32
+ : searchServiceSemanticRankerLevel
31
33
32
34
param storageAccountName string = '' // Set in main.parameters.json
33
35
param storageResourceGroupName string = '' // Set in main.parameters.json
@@ -40,7 +42,7 @@ param userStorageContainerName string = 'user-content'
40
42
41
43
param appServiceSkuName string // Set in main.parameters.json
42
44
43
- @allowed ([ 'azure' , 'openai' , 'azure_custom' ])
45
+ @allowed (['azure' , 'openai' , 'azure_custom' ])
44
46
param openAiHost string // Set in main.parameters.json
45
47
param isAzureOpenAiHost bool = startsWith (openAiHost , 'azure' )
46
48
param deployAzureOpenAi bool = openAiHost == 'azure'
@@ -58,7 +60,18 @@ param speechServiceSkuName string // Set in main.parameters.json
58
60
param useGPT4V bool = false
59
61
60
62
@description ('Location for the OpenAI resource group' )
61
- @allowed ([ 'canadaeast' , 'eastus' , 'eastus2' , 'francecentral' , 'switzerlandnorth' , 'uksouth' , 'japaneast' , 'northcentralus' , 'australiaeast' , 'swedencentral' ])
63
+ @allowed ([
64
+ 'canadaeast'
65
+ 'eastus'
66
+ 'eastus2'
67
+ 'francecentral'
68
+ 'switzerlandnorth'
69
+ 'uksouth'
70
+ 'japaneast'
71
+ 'northcentralus'
72
+ 'australiaeast'
73
+ 'swedencentral'
74
+ ])
62
75
@metadata ({
63
76
azd : {
64
77
type : 'location'
@@ -78,7 +91,7 @@ param documentIntelligenceResourceGroupName string = '' // Set in main.parameter
78
91
// Limited regions for new version:
79
92
// https://learn.microsoft.com/azure/ai-services/document-intelligence/concept-layout
80
93
@description ('Location for the Document Intelligence resource group' )
81
- @allowed ([ 'eastus' , 'westus2' , 'westeurope' ])
94
+ @allowed (['eastus' , 'westus2' , 'westeurope' ])
82
95
@metadata ({
83
96
azd : {
84
97
type : 'location'
@@ -98,7 +111,9 @@ param chatGptDeploymentName string = ''
98
111
param chatGptDeploymentVersion string = ''
99
112
param chatGptDeploymentCapacity int = 0
100
113
var chatGpt = {
101
- modelName : !empty (chatGptModelName ) ? chatGptModelName : startsWith (openAiHost , 'azure' ) ? 'gpt-35-turbo' : 'gpt-3.5-turbo'
114
+ modelName : !empty (chatGptModelName )
115
+ ? chatGptModelName
116
+ : startsWith (openAiHost , 'azure' ) ? 'gpt-35-turbo' : 'gpt-3.5-turbo'
102
117
deploymentName : !empty (chatGptDeploymentName ) ? chatGptDeploymentName : 'chat'
103
118
deploymentVersion : !empty (chatGptDeploymentVersion ) ? chatGptDeploymentVersion : '0613'
104
119
deploymentCapacity : chatGptDeploymentCapacity != 0 ? chatGptDeploymentCapacity : 30
@@ -143,12 +158,12 @@ param clientAppSecret string = ''
143
158
// Used for optional CORS support for alternate frontends
144
159
param allowedOrigin string = '' // should start with https://, shouldn't end with a /
145
160
146
- @allowed ([ 'None' , 'AzureServices' ])
161
+ @allowed (['None' , 'AzureServices' ])
147
162
@description ('If allowedIp is set, whether azure services are allowed to bypass the storage and AI services firewall.' )
148
163
param bypass string = 'AzureServices'
149
164
150
165
@description ('Public network access value for all deployed resources' )
151
- @allowed ([ 'Enabled' , 'Disabled' ])
166
+ @allowed (['Enabled' , 'Disabled' ])
152
167
param publicNetworkAccess string = 'Enabled'
153
168
154
169
@description ('Add a private endpoints for network connectivity' )
@@ -229,8 +244,12 @@ module monitoring 'core/monitor/monitoring.bicep' = if (useApplicationInsights)
229
244
params : {
230
245
location : location
231
246
tags : tags
232
- applicationInsightsName : !empty (applicationInsightsName ) ? applicationInsightsName : '${abbrs .insightsComponents }${resourceToken }'
233
- logAnalyticsName : !empty (logAnalyticsName ) ? logAnalyticsName : '${abbrs .operationalInsightsWorkspaces }${resourceToken }'
247
+ applicationInsightsName : !empty (applicationInsightsName )
248
+ ? applicationInsightsName
249
+ : '${abbrs .insightsComponents }${resourceToken }'
250
+ logAnalyticsName : !empty (logAnalyticsName )
251
+ ? logAnalyticsName
252
+ : '${abbrs .operationalInsightsWorkspaces }${resourceToken }'
234
253
publicNetworkAccess : publicNetworkAccess
235
254
}
236
255
}
@@ -239,7 +258,9 @@ module applicationInsightsDashboard 'backend-dashboard.bicep' = if (useApplicati
239
258
name : 'application-insights-dashboard'
240
259
scope : resourceGroup
241
260
params : {
242
- name : !empty (applicationInsightsDashboardName ) ? applicationInsightsDashboardName : '${abbrs .portalDashboards }${resourceToken }'
261
+ name : !empty (applicationInsightsDashboardName )
262
+ ? applicationInsightsDashboardName
263
+ : '${abbrs .portalDashboards }${resourceToken }'
243
264
location : location
244
265
applicationInsightsName : useApplicationInsights ? monitoring .outputs .applicationInsightsName : ''
245
266
}
@@ -277,7 +298,7 @@ module backend 'core/host/appservice.bicep' = {
277
298
managedIdentity : true
278
299
virtualNetworkSubnetId : isolation .outputs .appSubnetId
279
300
publicNetworkAccess : publicNetworkAccess
280
- allowedOrigins : [ allowedOrigin ]
301
+ allowedOrigins : [allowedOrigin ]
281
302
clientAppId : clientAppId
282
303
serverAppId : serverAppId
283
304
enableUnauthenticatedAccess : enableUnauthenticatedAccess
@@ -295,7 +316,9 @@ module backend 'core/host/appservice.bicep' = {
295
316
AZURE_VISION_ENDPOINT : useGPT4V ? computerVision .outputs .endpoint : ''
296
317
AZURE_SEARCH_QUERY_LANGUAGE : searchQueryLanguage
297
318
AZURE_SEARCH_QUERY_SPELLER : searchQuerySpeller
298
- APPLICATIONINSIGHTS_CONNECTION_STRING : useApplicationInsights ? monitoring .outputs .applicationInsightsConnectionString : ''
319
+ APPLICATIONINSIGHTS_CONNECTION_STRING : useApplicationInsights
320
+ ? monitoring .outputs .applicationInsightsConnectionString
321
+ : ''
299
322
AZURE_SPEECH_SERVICE_ID : useSpeechOutputAzure ? speech .outputs .resourceId : ''
300
323
AZURE_SPEECH_SERVICE_LOCATION : useSpeechOutputAzure ? speech .outputs .location : ''
301
324
ENABLE_LANGUAGE_PICKER : enableLanguagePicker
@@ -372,20 +395,25 @@ var defaultOpenAiDeployments = [
372
395
}
373
396
]
374
397
375
- var openAiDeployments = concat (defaultOpenAiDeployments , useGPT4V ? [
376
- {
377
- name : gpt4vDeploymentName
378
- model : {
379
- format : 'OpenAI'
380
- name : gpt4vModelName
381
- version : gpt4vModelVersion
382
- }
383
- sku : {
384
- name : 'Standard'
385
- capacity : gpt4vDeploymentCapacity
386
- }
387
- }
388
- ] : [])
398
+ var openAiDeployments = concat (
399
+ defaultOpenAiDeployments ,
400
+ useGPT4V
401
+ ? [
402
+ {
403
+ name : gpt4vDeploymentName
404
+ model : {
405
+ format : 'OpenAI'
406
+ name : gpt4vModelName
407
+ version : gpt4vModelVersion
408
+ }
409
+ sku : {
410
+ name : 'Standard'
411
+ capacity : gpt4vDeploymentCapacity
412
+ }
413
+ }
414
+ ]
415
+ : []
416
+ )
389
417
390
418
module openAi 'br/public:avm/res/cognitive-services/account:0.5.4' = if (isAzureOpenAiHost && deployAzureOpenAi ) {
391
419
name : 'openai'
@@ -395,7 +423,9 @@ module openAi 'br/public:avm/res/cognitive-services/account:0.5.4' = if (isAzure
395
423
location : openAiResourceGroupLocation
396
424
tags : tags
397
425
kind : 'OpenAI'
398
- customSubDomainName : !empty (openAiServiceName ) ? openAiServiceName : '${abbrs .cognitiveServicesAccounts }${resourceToken }'
426
+ customSubDomainName : !empty (openAiServiceName )
427
+ ? openAiServiceName
428
+ : '${abbrs .cognitiveServicesAccounts }${resourceToken }'
399
429
publicNetworkAccess : publicNetworkAccess
400
430
networkAcls : {
401
431
defaultAction : 'Allow'
@@ -413,9 +443,13 @@ module documentIntelligence 'br/public:avm/res/cognitive-services/account:0.5.4'
413
443
name : 'documentintelligence'
414
444
scope : documentIntelligenceResourceGroup
415
445
params : {
416
- name : !empty (documentIntelligenceServiceName ) ? documentIntelligenceServiceName : '${abbrs .cognitiveServicesDocumentIntelligence }${resourceToken }'
446
+ name : !empty (documentIntelligenceServiceName )
447
+ ? documentIntelligenceServiceName
448
+ : '${abbrs .cognitiveServicesDocumentIntelligence }${resourceToken }'
417
449
kind : 'FormRecognizer'
418
- customSubDomainName : !empty (documentIntelligenceServiceName ) ? documentIntelligenceServiceName : '${abbrs .cognitiveServicesDocumentIntelligence }${resourceToken }'
450
+ customSubDomainName : !empty (documentIntelligenceServiceName )
451
+ ? documentIntelligenceServiceName
452
+ : '${abbrs .cognitiveServicesDocumentIntelligence }${resourceToken }'
419
453
publicNetworkAccess : publicNetworkAccess
420
454
networkAcls : {
421
455
defaultAction : 'Allow'
@@ -456,7 +490,9 @@ module speech 'br/public:avm/res/cognitive-services/account:0.5.4' = if (useSpee
456
490
networkAcls : {
457
491
defaultAction : 'Allow'
458
492
}
459
- customSubDomainName : !empty (speechServiceName ) ? speechServiceName : '${abbrs .cognitiveServicesSpeech }${resourceToken }'
493
+ customSubDomainName : !empty (speechServiceName )
494
+ ? speechServiceName
495
+ : '${abbrs .cognitiveServicesSpeech }${resourceToken }'
460
496
location : !empty (speechServiceLocation ) ? speechServiceLocation : location
461
497
tags : tags
462
498
sku : speechServiceSkuName
@@ -474,8 +510,10 @@ module searchService 'core/search/search-services.bicep' = {
474
510
name : searchServiceSkuName
475
511
}
476
512
semanticSearch : actualSearchServiceSemanticRankerLevel
477
- publicNetworkAccess : publicNetworkAccess == 'Enabled' ? 'enabled' : (publicNetworkAccess == 'Disabled' ? 'disabled' : null )
478
- sharedPrivateLinkStorageAccounts : usePrivateEndpoint ? [ storage .outputs .id ] : []
513
+ publicNetworkAccess : publicNetworkAccess == 'Enabled'
514
+ ? 'enabled'
515
+ : (publicNetworkAccess == 'Disabled' ? 'disabled' : null )
516
+ sharedPrivateLinkStorageAccounts : usePrivateEndpoint ? [storage .outputs .id ] : []
479
517
}
480
518
}
481
519
@@ -519,7 +557,9 @@ module userStorage 'core/storage/storage-account.bicep' = if (useUserUpload) {
519
557
name : 'user-storage'
520
558
scope : storageResourceGroup
521
559
params : {
522
- name : !empty (userStorageAccountName ) ? userStorageAccountName : 'user${abbrs .storageStorageAccounts }${resourceToken }'
560
+ name : !empty (userStorageAccountName )
561
+ ? userStorageAccountName
562
+ : 'user${abbrs .storageStorageAccounts }${resourceToken }'
523
563
location : storageResourceGroupLocation
524
564
tags : tags
525
565
publicNetworkAccess : publicNetworkAccess
@@ -720,36 +760,38 @@ module isolation 'network-isolation.bicep' = {
720
760
721
761
var environmentData = environment ()
722
762
723
- var openAiPrivateEndpointConnection = (isAzureOpenAiHost && deployAzureOpenAi ) ? [{
724
- groupId : 'account'
725
- dnsZoneName : 'privatelink.openai.azure.com'
726
- resourceIds : concat (
727
- [ openAi .outputs .resourceId ],
728
- useGPT4V ? [ computerVision .outputs .resourceId ] : [],
729
- !useLocalPdfParser ? [ documentIntelligence .outputs .resourceId ] : []
730
- )
731
- }] : []
732
- var otherPrivateEndpointConnections = usePrivateEndpoint ? [
733
- {
734
- groupId : 'blob'
735
- dnsZoneName : 'privatelink.blob.${environmentData .suffixes .storage }'
736
- resourceIds : concat (
737
- [ storage .outputs .id ],
738
- useUserUpload ? [ userStorage .outputs .id ] : []
739
- )
740
- }
741
- {
742
- groupId : 'searchService'
743
- dnsZoneName : 'privatelink.search.windows.net'
744
- resourceIds : [ searchService .outputs .id ]
745
- }
746
- {
747
- groupId : 'sites'
748
- dnsZoneName : 'privatelink.azurewebsites.net'
749
- resourceIds : [ backend .outputs .id ]
750
- }
751
- ] : []
752
-
763
+ var openAiPrivateEndpointConnection = (isAzureOpenAiHost && deployAzureOpenAi )
764
+ ? [
765
+ {
766
+ groupId : 'account'
767
+ dnsZoneName : 'privatelink.openai.azure.com'
768
+ resourceIds : concat (
769
+ [openAi .outputs .resourceId ],
770
+ useGPT4V ? [computerVision .outputs .resourceId ] : [],
771
+ !useLocalPdfParser ? [documentIntelligence .outputs .resourceId ] : []
772
+ )
773
+ }
774
+ ]
775
+ : []
776
+ var otherPrivateEndpointConnections = usePrivateEndpoint
777
+ ? [
778
+ {
779
+ groupId : 'blob'
780
+ dnsZoneName : 'privatelink.blob.${environmentData .suffixes .storage }'
781
+ resourceIds : concat ([storage .outputs .id ], useUserUpload ? [userStorage .outputs .id ] : [])
782
+ }
783
+ {
784
+ groupId : 'searchService'
785
+ dnsZoneName : 'privatelink.search.windows.net'
786
+ resourceIds : [searchService .outputs .id ]
787
+ }
788
+ {
789
+ groupId : 'sites'
790
+ dnsZoneName : 'privatelink.azurewebsites.net'
791
+ resourceIds : [backend .outputs .id ]
792
+ }
793
+ ]
794
+ : []
753
795
754
796
var privateEndpointConnections = concat (otherPrivateEndpointConnections , openAiPrivateEndpointConnection )
755
797
0 commit comments