@@ -924,7 +924,7 @@ var privateDnsZones = [
924924 'privatelink.documents.azure.com'
925925 'privatelink.${toLower (replace (location ,' ' ,'' ))}.azurecontainerapps.io'
926926 'privatelink.azurewebsites.net'
927- ]
927+ ]
928928
929929// DNS Zone Index Constants
930930var dnsZoneIndex = {
@@ -936,10 +936,22 @@ var dnsZoneIndex = {
936936 appService : 5
937937}
938938
939+ // List of DNS zone indices that correspond to AI-related services.
940+ var aiRelatedDnsZoneIndices = [
941+ dnsZoneIndex .cognitiveServices
942+ dnsZoneIndex .openAI
943+ dnsZoneIndex .aiServices
944+ ]
945+
946+ // ===================================================
947+ // DEPLOY PRIVATE DNS ZONES
948+ // - Deploys all zones if no existing Foundry project is used
949+ // - Excludes AI-related zones when using with an existing Foundry project
950+ // ===================================================
939951@batchSize (5 )
940952module avmPrivateDnsZones 'br/public:avm/res/network/private-dns-zone:0.7.1' = [
941- for (zone , i ) in privateDnsZones : if (enablePrivateNetworking ) {
942- name : 'avm.res.network.private-dns-zone.${i }'
953+ for (zone , i ) in privateDnsZones : if (enablePrivateNetworking && ( empty ( existingFoundryProjectResourceId ) || ! contains ( aiRelatedDnsZoneIndices , i )) ) {
954+ name : 'avm.res.network.private-dns-zone.${contains ( zone , 'azurecontainerapps.io' ) ? 'containerappenv' : split ( zone , '.' )[ 1 ] }'
943955 params : {
944956 name : zone
945957 tags : tags
@@ -1194,8 +1206,6 @@ module containerAppEnvironment 'br/public:avm/res/app/managed-environment:0.11.2
11941206 }
11951207}
11961208
1197-
1198-
11991209// Private Endpoint for Container App Environment
12001210var privateEndpointContainerAppEnvironmentService = 'managedEnvironments'
12011211module privateEndpointContainerAppEnvironment 'br:mcr.microsoft.com/bicep/avm/res/network/private-endpoint:0.11.0' = if (enablePrivateNetworking ) {
0 commit comments