@@ -924,7 +924,7 @@ var privateDnsZones = [
924
924
'privatelink.documents.azure.com'
925
925
'privatelink.${toLower (replace (location ,' ' ,'' ))}.azurecontainerapps.io'
926
926
'privatelink.azurewebsites.net'
927
- ]
927
+ ]
928
928
929
929
// DNS Zone Index Constants
930
930
var dnsZoneIndex = {
@@ -936,10 +936,22 @@ var dnsZoneIndex = {
936
936
appService : 5
937
937
}
938
938
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
+ // ===================================================
939
951
@batchSize (5 )
940
952
module 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 ] }'
943
955
params : {
944
956
name : zone
945
957
tags : tags
@@ -1194,8 +1206,6 @@ module containerAppEnvironment 'br/public:avm/res/app/managed-environment:0.11.2
1194
1206
}
1195
1207
}
1196
1208
1197
-
1198
-
1199
1209
// Private Endpoint for Container App Environment
1200
1210
var privateEndpointContainerAppEnvironmentService = 'managedEnvironments'
1201
1211
module privateEndpointContainerAppEnvironment 'br:mcr.microsoft.com/bicep/avm/res/network/private-endpoint:0.11.0' = if (enablePrivateNetworking ) {
0 commit comments