Skip to content

Commit 75ca62b

Browse files
updated privet endpoint changes
1 parent d224d34 commit 75ca62b

File tree

3 files changed

+673
-188
lines changed

3 files changed

+673
-188
lines changed

infra/main.bicep

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -480,45 +480,47 @@ module existingAiFoundryAiServicesDeployments 'modules/ai-services-deployments.b
480480
}
481481

482482
// ========== Private Endpoint for Existing AI Services ========== //
483-
// Always create private endpoint when using existing AI Services with private networking enabled
484483
var shouldCreatePrivateEndpoint = useExistingAiFoundryAiProject && enablePrivateNetworking
485-
486-
// Use existing DNS zones if provided, otherwise use newly created ones
487-
var privateDnsZoneIds = {
488-
cognitiveServices: avmPrivateDnsZones[dnsZoneIndex.cognitiveServices]!.outputs.resourceId
489-
openAI: avmPrivateDnsZones[dnsZoneIndex.openAI]!.outputs.resourceId
490-
aiServices: avmPrivateDnsZones[dnsZoneIndex.aiServices]!.outputs.resourceId
491-
}
492-
493-
module existingAiServicesPrivateEndpoint 'modules/private-endpoint.bicep' = if (shouldCreatePrivateEndpoint) {
484+
module existingAiServicesPrivateEndpoint 'br/public:avm/res/network/private-endpoint:0.11.0' = if (shouldCreatePrivateEndpoint) {
494485
name: take('module.private-endpoint.${existingAiFoundryAiServices.name}', 64)
495-
scope: resourceGroup()
496486
params: {
497487
name: 'pep-${existingAiFoundryAiServices.name}'
498488
location: location
499489
subnetResourceId: network!.outputs.subnetPrivateEndpointsResourceId
500-
targetResourceId: existingAiFoundryAiServices.id
501-
groupIds: ['account']
502490
customNetworkInterfaceName: 'nic-${existingAiFoundryAiServices.name}'
503-
tags: tags
504-
privateDnsZoneGroupConfigs: [
505-
{
506-
name: 'ai-services-dns-zone-cognitiveservices'
507-
privateDnsZoneResourceId: privateDnsZoneIds.cognitiveServices
508-
}
509-
{
510-
name: 'ai-services-dns-zone-openai'
511-
privateDnsZoneResourceId: privateDnsZoneIds.openAI
512-
}
491+
privateDnsZoneGroup: {
492+
privateDnsZoneGroupConfigs: [
493+
{
494+
name: 'ai-services-dns-zone-cognitiveservices'
495+
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.cognitiveServices]!.outputs.resourceId
496+
}
497+
{
498+
name: 'ai-services-dns-zone-openai'
499+
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.openAI]!.outputs.resourceId
500+
}
501+
{
502+
name: 'ai-services-dns-zone-aiservices'
503+
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.aiServices]!.outputs.resourceId
504+
}
505+
]
506+
}
507+
privateLinkServiceConnections: [
513508
{
514-
name: 'ai-services-dns-zone-aiservices'
515-
privateDnsZoneResourceId: privateDnsZoneIds.aiServices
509+
name: 'pep-${existingAiFoundryAiServices.name}'
510+
properties: {
511+
groupIds: ['account']
512+
privateLinkServiceId: existingAiFoundryAiServices.id
513+
}
516514
}
517515
]
516+
tags: tags
518517
}
518+
dependsOn: [
519+
existingAiFoundryAiServices
520+
avmPrivateDnsZones
521+
]
519522
}
520523

521-
522524
module aiFoundryAiServices 'br:mcr.microsoft.com/bicep/avm/res/cognitive-services/account:0.13.2' = if (!useExistingAiFoundryAiProject) {
523525
name: take('avm.res.cognitive-services.account.${aiFoundryAiServicesResourceName}', 64)
524526
params: {

0 commit comments

Comments
 (0)