Skip to content

Commit f71fe42

Browse files
2 parents 3e90e85 + 2f7c349 commit f71fe42

2 files changed

Lines changed: 34 additions & 31 deletions

File tree

infra/main.bicep

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ var solutionPrefix = 'cps-${padLeft(take(toLower(uniqueString(subscription().id,
9191
// Resources //
9292
// ============== //
9393

94+
var existingProjectResourceId = trim(existingFoundryProjectResourceId)
95+
9496
// ========== AVM Telemetry ========== //
9597
#disable-next-line no-deployments-resources
9698
resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableTelemetry) {
@@ -579,7 +581,7 @@ module avmAiServices 'modules/account/main.bicep' = {
579581
name: 'aisa-${solutionPrefix}'
580582
projectName: 'aifp-${solutionPrefix}'
581583
projectDescription: 'aifp-${solutionPrefix}'
582-
existingFoundryProjectResourceId: existingFoundryProjectResourceId
584+
existingFoundryProjectResourceId: existingProjectResourceId
583585
location: aiDeploymentsLocation
584586
sku: 'S0'
585587
allowProjectManagement: true
@@ -632,7 +634,7 @@ module avmAiServices 'modules/account/main.bicep' = {
632634
// WAF related parameters
633635
publicNetworkAccess: (enablePrivateNetworking) ? 'Disabled' : 'Enabled'
634636
//publicNetworkAccess: 'Enabled' // Always enabled for AI Services
635-
privateEndpoints: (enablePrivateNetworking)
637+
privateEndpoints: (enablePrivateNetworking && empty(existingProjectResourceId))
636638
? [
637639
{
638640
name: 'ai-services-private-endpoint-${solutionPrefix}'

infra/main.json

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"metadata": {
66
"_generator": {
77
"name": "bicep",
8-
"version": "0.36.177.2456",
9-
"templateHash": "17580921797975596025"
8+
"version": "0.37.4.10188",
9+
"templateHash": "3135336995747769121"
1010
},
1111
"name": "Content Processing Solution Accelerator",
1212
"description": "Bicep template to deploy the Content Processing Solution Accelerator with AVM compliance."
@@ -167,6 +167,7 @@
167167
},
168168
"variables": {
169169
"solutionPrefix": "[format('cps-{0}', padLeft(take(toLower(uniqueString(subscription().id, parameters('environmentName'), resourceGroup().location, resourceGroup().name)), 12), 12, '0'))]",
170+
"existingProjectResourceId": "[trim(parameters('existingFoundryProjectResourceId'))]",
170171
"privateDnsZones": [
171172
"privatelink.cognitiveservices.azure.com",
172173
"privatelink.openai.azure.com",
@@ -7908,8 +7909,8 @@
79087909
"metadata": {
79097910
"_generator": {
79107911
"name": "bicep",
7911-
"version": "0.36.177.2456",
7912-
"templateHash": "3906046175102371285"
7912+
"version": "0.37.4.10188",
7913+
"templateHash": "6972956072693401058"
79137914
}
79147915
},
79157916
"parameters": {
@@ -11793,8 +11794,8 @@
1179311794
"metadata": {
1179411795
"_generator": {
1179511796
"name": "bicep",
11796-
"version": "0.36.177.2456",
11797-
"templateHash": "14410385321137128263"
11797+
"version": "0.37.4.10188",
11798+
"templateHash": "7249387422952826813"
1179811799
}
1179911800
},
1180011801
"parameters": {
@@ -12384,8 +12385,8 @@
1238412385
"metadata": {
1238512386
"_generator": {
1238612387
"name": "bicep",
12387-
"version": "0.36.177.2456",
12388-
"templateHash": "12745773382509549839"
12388+
"version": "0.37.4.10188",
12389+
"templateHash": "16532605725531152234"
1238912390
},
1239012391
"name": "Key Vault Module"
1239112392
},
@@ -15923,8 +15924,8 @@
1592315924
"metadata": {
1592415925
"_generator": {
1592515926
"name": "bicep",
15926-
"version": "0.36.177.2456",
15927-
"templateHash": "11092248228709008584"
15927+
"version": "0.37.4.10188",
15928+
"templateHash": "1461768805384515582"
1592815929
},
1592915930
"name": "Container Registry Module"
1593015931
},
@@ -24898,8 +24899,8 @@
2489824899
"avmContainerApp",
2489924900
"avmContainerApp_API",
2490024901
"avmManagedIdentity",
24901-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
2490224902
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
24903+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
2490324904
"avmVirtualNetwork"
2490424905
]
2490524906
},
@@ -24923,7 +24924,7 @@
2492324924
"value": "[format('aifp-{0}', variables('solutionPrefix'))]"
2492424925
},
2492524926
"existingFoundryProjectResourceId": {
24926-
"value": "[parameters('existingFoundryProjectResourceId')]"
24927+
"value": "[variables('existingProjectResourceId')]"
2492724928
},
2492824929
"location": {
2492924930
"value": "[parameters('aiDeploymentsLocation')]"
@@ -25002,7 +25003,7 @@
2500225003
]
2500325004
},
2500425005
"publicNetworkAccess": "[if(parameters('enablePrivateNetworking'), createObject('value', 'Disabled'), createObject('value', 'Enabled'))]",
25005-
"privateEndpoints": "[if(parameters('enablePrivateNetworking'), createObject('value', createArray(createObject('name', format('ai-services-private-endpoint-{0}', variables('solutionPrefix')), 'privateEndpointResourceId', reference('avmVirtualNetwork').outputs.resourceId.value, 'privateDnsZoneGroup', createObject('privateDnsZoneGroupConfigs', createArray(createObject('name', 'ai-services-dns-zone-cognitiveservices', 'privateDnsZoneResourceId', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)).outputs.resourceId.value), createObject('name', 'ai-services-dns-zone-openai', 'privateDnsZoneResourceId', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)).outputs.resourceId.value), createObject('name', 'ai-services-dns-zone-aiservices', 'privateDnsZoneResourceId', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)).outputs.resourceId.value), createObject('name', 'ai-services-dns-zone-contentunderstanding', 'privateDnsZoneResourceId', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').contentUnderstanding)).outputs.resourceId.value))), 'subnetResourceId', reference('avmVirtualNetwork').outputs.subnetResourceIds.value[0]))), createObject('value', createArray()))]"
25006+
"privateEndpoints": "[if(and(parameters('enablePrivateNetworking'), empty(variables('existingProjectResourceId'))), createObject('value', createArray(createObject('name', format('ai-services-private-endpoint-{0}', variables('solutionPrefix')), 'privateEndpointResourceId', reference('avmVirtualNetwork').outputs.resourceId.value, 'privateDnsZoneGroup', createObject('privateDnsZoneGroupConfigs', createArray(createObject('name', 'ai-services-dns-zone-cognitiveservices', 'privateDnsZoneResourceId', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)).outputs.resourceId.value), createObject('name', 'ai-services-dns-zone-openai', 'privateDnsZoneResourceId', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)).outputs.resourceId.value), createObject('name', 'ai-services-dns-zone-aiservices', 'privateDnsZoneResourceId', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)).outputs.resourceId.value), createObject('name', 'ai-services-dns-zone-contentunderstanding', 'privateDnsZoneResourceId', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').contentUnderstanding)).outputs.resourceId.value))), 'subnetResourceId', reference('avmVirtualNetwork').outputs.subnetResourceIds.value[0]))), createObject('value', createArray()))]"
2500625007
},
2500725008
"template": {
2500825009
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
@@ -25011,8 +25012,8 @@
2501125012
"metadata": {
2501225013
"_generator": {
2501325014
"name": "bicep",
25014-
"version": "0.36.177.2456",
25015-
"templateHash": "5761548449731819585"
25015+
"version": "0.37.4.10188",
25016+
"templateHash": "6573158563370865051"
2501625017
},
2501725018
"name": "Cognitive Services",
2501825019
"description": "This module deploys a Cognitive Service."
@@ -26261,8 +26262,8 @@
2626126262
"metadata": {
2626226263
"_generator": {
2626326264
"name": "bicep",
26264-
"version": "0.36.177.2456",
26265-
"templateHash": "11270933172961789567"
26265+
"version": "0.37.4.10188",
26266+
"templateHash": "9510507771164523365"
2626626267
}
2626726268
},
2626826269
"definitions": {
@@ -28070,8 +28071,8 @@
2807028071
"metadata": {
2807128072
"_generator": {
2807228073
"name": "bicep",
28073-
"version": "0.36.177.2456",
28074-
"templateHash": "9150529619101779014"
28074+
"version": "0.37.4.10188",
28075+
"templateHash": "2491273843075489892"
2807528076
}
2807628077
},
2807728078
"definitions": {
@@ -28224,8 +28225,8 @@
2822428225
"metadata": {
2822528226
"_generator": {
2822628227
"name": "bicep",
28227-
"version": "0.36.177.2456",
28228-
"templateHash": "18131656256983910282"
28228+
"version": "0.37.4.10188",
28229+
"templateHash": "13991828250771551903"
2822928230
}
2823028231
},
2823128232
"definitions": {
@@ -28442,8 +28443,8 @@
2844228443
"metadata": {
2844328444
"_generator": {
2844428445
"name": "bicep",
28445-
"version": "0.36.177.2456",
28446-
"templateHash": "11270933172961789567"
28446+
"version": "0.37.4.10188",
28447+
"templateHash": "9510507771164523365"
2844728448
}
2844828449
},
2844928450
"definitions": {
@@ -30251,8 +30252,8 @@
3025130252
"metadata": {
3025230253
"_generator": {
3025330254
"name": "bicep",
30254-
"version": "0.36.177.2456",
30255-
"templateHash": "9150529619101779014"
30255+
"version": "0.37.4.10188",
30256+
"templateHash": "2491273843075489892"
3025630257
}
3025730258
},
3025830259
"definitions": {
@@ -30405,8 +30406,8 @@
3040530406
"metadata": {
3040630407
"_generator": {
3040730408
"name": "bicep",
30408-
"version": "0.36.177.2456",
30409-
"templateHash": "18131656256983910282"
30409+
"version": "0.37.4.10188",
30410+
"templateHash": "13991828250771551903"
3041030411
}
3041130412
},
3041230413
"definitions": {
@@ -30647,9 +30648,9 @@
3064730648
"avmContainerApp",
3064830649
"avmManagedIdentity",
3064930650
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
30651+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
3065030652
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
3065130653
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').contentUnderstanding)]",
30652-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
3065330654
"avmVirtualNetwork",
3065430655
"logAnalyticsWorkspace"
3065530656
]
@@ -32987,8 +32988,8 @@
3298732988
"dependsOn": [
3298832989
"avmContainerApp",
3298932990
"avmManagedIdentity",
32990-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').contentUnderstanding)]",
3299132991
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
32992+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').contentUnderstanding)]",
3299232993
"avmVirtualNetwork"
3299332994
]
3299432995
},

0 commit comments

Comments
 (0)