Skip to content

Commit 08cf17d

Browse files
Merge pull request #869 from microsoft/hb-psl-us-37902
refactor: refactor private endpoint configuration to deploy separately via aiFoundryPrivateEndpoint module
2 parents c849d02 + 52473be commit 08cf17d

File tree

3 files changed

+857
-56
lines changed

3 files changed

+857
-56
lines changed

infra/main.bicep

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -966,34 +966,48 @@ module aiFoundryAiServices 'br:mcr.microsoft.com/bicep/avm/res/cognitive-service
966966
// WAF aligned configuration for Monitoring
967967
diagnosticSettings: enableMonitoring ? [{ workspaceResourceId: logAnalyticsWorkspaceResourceId }] : null
968968
publicNetworkAccess: enablePrivateNetworking ? 'Disabled' : 'Enabled'
969-
privateEndpoints: (enablePrivateNetworking)
970-
? ([
971-
{
972-
name: 'pep-${aiFoundryAiServicesResourceName}'
973-
customNetworkInterfaceName: 'nic-${aiFoundryAiServicesResourceName}'
974-
subnetResourceId: virtualNetwork!.outputs.backendSubnetResourceId
975-
privateDnsZoneGroup: {
976-
privateDnsZoneGroupConfigs: [
977-
{
978-
name: 'ai-services-dns-zone-cognitiveservices'
979-
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.cognitiveServices]!.outputs.resourceId
980-
}
981-
{
982-
name: 'ai-services-dns-zone-openai'
983-
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.openAI]!.outputs.resourceId
984-
}
985-
{
986-
name: 'ai-services-dns-zone-aiservices'
987-
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.aiServices]!.outputs.resourceId
988-
}
989-
]
990-
}
991-
}
992-
])
993-
: []
969+
// Private endpoints are deployed separately via the aiFoundryPrivateEndpoint module below
970+
privateEndpoints: []
994971
}
995972
}
996973

974+
module aiFoundryPrivateEndpoint 'br/public:avm/res/network/private-endpoint:0.8.1' = if (enablePrivateNetworking && !useExistingAiFoundryAiProject) {
975+
name: take('pep-${aiFoundryAiServicesResourceName}-deployment', 64)
976+
params: {
977+
name: 'pep-${aiFoundryAiServicesResourceName}'
978+
customNetworkInterfaceName: 'nic-${aiFoundryAiServicesResourceName}'
979+
location: azureAiServiceLocation
980+
tags: tags
981+
privateLinkServiceConnections: [
982+
{
983+
name: 'pep-${aiFoundryAiServicesResourceName}-connection'
984+
properties: {
985+
privateLinkServiceId: aiFoundryAiServices!.outputs.resourceId
986+
groupIds: ['account']
987+
}
988+
}
989+
]
990+
privateDnsZoneGroup: {
991+
privateDnsZoneGroupConfigs: [
992+
{
993+
name: 'ai-services-dns-zone-cognitiveservices'
994+
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.cognitiveServices]!.outputs.resourceId
995+
}
996+
{
997+
name: 'ai-services-dns-zone-openai'
998+
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.openAI]!.outputs.resourceId
999+
}
1000+
{
1001+
name: 'ai-services-dns-zone-aiservices'
1002+
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.aiServices]!.outputs.resourceId
1003+
}
1004+
]
1005+
}
1006+
subnetResourceId: virtualNetwork!.outputs.backendSubnetResourceId
1007+
}
1008+
}
1009+
1010+
9971011
resource existingAiFoundryAiServicesProject 'Microsoft.CognitiveServices/accounts/projects@2025-06-01' existing = if (useExistingAiFoundryAiProject) {
9981012
name: aiFoundryAiProjectResourceName
9991013
parent: existingAiFoundryAiServices

0 commit comments

Comments
 (0)