@@ -124,7 +124,7 @@ param enableRedundancy bool = false
124124param enablePrivateNetworking bool = false
125125
126126@description ('Optional. The Container Registry hostname where the docker images are located.' )
127- param acrName string = 'byocgacontainerreg' // testapwaf
127+ param acrName string = 'byocgacontainerreg'
128128
129129@description ('Optional. Image Tag.' )
130130param imageTag string = 'latest_waf_2025-09-18_736'
@@ -568,6 +568,48 @@ module existingAiFoundryAiServicesDeployments 'modules/ai-services-deployments.b
568568 }
569569}
570570
571+ // ========== Private Endpoint for Existing AI Services ========== //
572+ var shouldCreatePrivateEndpoint = useExistingAiFoundryAiProject && enablePrivateNetworking
573+ module existingAiServicesPrivateEndpoint 'br/public:avm/res/network/private-endpoint:0.11.0' = if (shouldCreatePrivateEndpoint ) {
574+ name : take ('module.private-endpoint.${existingAiFoundryAiServices .name }' , 64 )
575+ params : {
576+ name : 'pep-${existingAiFoundryAiServices .name }'
577+ location : location
578+ subnetResourceId : virtualNetwork !.outputs .pepsSubnetResourceId
579+ customNetworkInterfaceName : 'nic-${existingAiFoundryAiServices .name }'
580+ privateDnsZoneGroup : {
581+ privateDnsZoneGroupConfigs : [
582+ {
583+ name : 'ai-services-dns-zone-cognitiveservices'
584+ privateDnsZoneResourceId : avmPrivateDnsZones [dnsZoneIndex .cognitiveServices ]!.outputs .resourceId
585+ }
586+ {
587+ name : 'ai-services-dns-zone-openai'
588+ privateDnsZoneResourceId : avmPrivateDnsZones [dnsZoneIndex .openAI ]!.outputs .resourceId
589+ }
590+ {
591+ name : 'ai-services-dns-zone-aiservices'
592+ privateDnsZoneResourceId : avmPrivateDnsZones [dnsZoneIndex .aiServices ]!.outputs .resourceId
593+ }
594+ ]
595+ }
596+ privateLinkServiceConnections : [
597+ {
598+ name : 'pep-${existingAiFoundryAiServices .name }'
599+ properties : {
600+ groupIds : ['account' ]
601+ privateLinkServiceId : existingAiFoundryAiServices .id
602+ }
603+ }
604+ ]
605+ tags : tags
606+ }
607+ dependsOn : [
608+ existingAiFoundryAiServices
609+ avmPrivateDnsZones
610+ ]
611+ }
612+
571613module aiFoundryAiServices 'br:mcr.microsoft.com/bicep/avm/res/cognitive-services/account:0.13.2' = if (!useExistingAiFoundryAiProject ) {
572614 name : take ('avm.res.cognitive-services.account.${aiFoundryAiServicesResourceName }' , 64 )
573615 params : {
@@ -673,7 +715,7 @@ module aiFoundryAiServicesProject 'modules/ai-project.bicep' = if (!useExistingA
673715}
674716
675717var aiFoundryAiProjectEndpoint = useExistingAiFoundryAiProject
676- ? existingAiFoundryAiServicesProject !. properties . endpoints [ 'AI Foundry API' ]
718+ ? 'https://${ aiFoundryAiServicesResourceName }.services.ai.azure.com/api/projects/${ aiFoundryAiProjectResourceName }'
677719 : aiFoundryAiServicesProject !.outputs .apiEndpoint
678720
679721// ========== Search Service to AI Services Role Assignment ========== //
0 commit comments