@@ -449,7 +449,7 @@ var aiRelatedDnsZoneIndices = [
449449// ===================================================
450450@batchSize (5 )
451451module avmPrivateDnsZones 'br/public:avm/res/network/private-dns-zone:0.7.1' = [
452- for (zone , i ) in privateDnsZones : if (enablePrivateNetworking && ( empty ( existingFoundryProjectResourceId ) || ! contains ( aiRelatedDnsZoneIndices , i )) ) {
452+ for (zone , i ) in privateDnsZones : if (enablePrivateNetworking ) {
453453 name : 'dns-zone-${i }'
454454 params : {
455455 name : zone
@@ -1070,6 +1070,47 @@ resource existingAiFoundryAiServicesProject 'Microsoft.CognitiveServices/account
10701070 parent : existingAiFoundryAiServices
10711071}
10721072
1073+ // ========== Private Endpoint for Existing AI Services ========== //
1074+ var shouldCreatePrivateEndpoint = useExistingAiFoundryAiProject && enablePrivateNetworking
1075+ module existingAiServicesPrivateEndpoint 'br/public:avm/res/network/private-endpoint:0.11.0' = if (shouldCreatePrivateEndpoint ) {
1076+ name : take ('module.private-endpoint.${existingAiFoundryAiServices .name }' , 64 )
1077+ params : {
1078+ name : 'pep-${existingAiFoundryAiServices .name }'
1079+ location : location
1080+ subnetResourceId : network !.outputs .subnetPrivateEndpointsResourceId
1081+ customNetworkInterfaceName : 'nic-${existingAiFoundryAiServices .name }'
1082+ privateDnsZoneGroup : {
1083+ privateDnsZoneGroupConfigs : [
1084+ {
1085+ name : 'ai-services-dns-zone-cognitiveservices'
1086+ privateDnsZoneResourceId : avmPrivateDnsZones [dnsZoneIndex .cognitiveServices ]!.outputs .resourceId
1087+ }
1088+ {
1089+ name : 'ai-services-dns-zone-openai'
1090+ privateDnsZoneResourceId : avmPrivateDnsZones [dnsZoneIndex .openAI ]!.outputs .resourceId
1091+ }
1092+ {
1093+ name : 'ai-services-dns-zone-aiservices'
1094+ privateDnsZoneResourceId : avmPrivateDnsZones [dnsZoneIndex .aiServices ]!.outputs .resourceId
1095+ }
1096+ ]
1097+ }
1098+ privateLinkServiceConnections : [
1099+ {
1100+ name : 'pep-${existingAiFoundryAiServices .name }'
1101+ properties : {
1102+ groupIds : ['account' ]
1103+ privateLinkServiceId : existingAiFoundryAiServices .id
1104+ }
1105+ }
1106+ ]
1107+ tags : tags
1108+ }
1109+ dependsOn : [
1110+ existingAiFoundryAiServices
1111+ avmPrivateDnsZones
1112+ ]
1113+ }
10731114
10741115var aiSearchName = 'srch-${solutionSuffix }'
10751116module searchService 'br/public:avm/res/search/search-service:0.11.1' = {
0 commit comments