From 321b9f9e89a2fffe0f20c7ea585458d47f6cbed1 Mon Sep 17 00:00:00 2001 From: Hugo Ribeiro Date: Thu, 15 Oct 2026 14:22:39 +0100 Subject: [PATCH] improve the deployment to support managed redis --- .../azurepolicy.json | 10 ++++++++-- .../azurepolicy.rules.json | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/policyDefinitions/Network/configure-private-endpoint-to-use-private-dns-zones-generic/azurepolicy.json b/policyDefinitions/Network/configure-private-endpoint-to-use-private-dns-zones-generic/azurepolicy.json index e204d0bf..a41ad9c5 100644 --- a/policyDefinitions/Network/configure-private-endpoint-to-use-private-dns-zones-generic/azurepolicy.json +++ b/policyDefinitions/Network/configure-private-endpoint-to-use-private-dns-zones-generic/azurepolicy.json @@ -118,7 +118,13 @@ "mappings":{ "microsoft.keyvault/vaults/vault" : [ ".vault.", - ".vaultcore." + ".vaultcore.", + "partial" + ], + "Microsoft.Cache/RedisEnterprise/redisEnterprise" : [ + ".redis.azure.net", + ".redis.azure.net", + "full" ] } }, @@ -175,7 +181,7 @@ "value": "[parameters('location')]" }, "customDnsConfigs": { - "value": "[if(equals(tryGet(variables('mappings'), variables('mappedName')), null()), map(coalesce(reference(variables('getPECurrentProperties')).outputs.resource.value.properties.customDnsConfigs, createArray()), lambda('dns', lambdaVariables('dns').fqdn)), map(coalesce(reference(variables('getPECurrentProperties')).outputs.resource.value.properties.customDnsConfigs, createArray()), lambda('dns', replace(lambdaVariables('dns').fqdn, tryGet(variables('mappings'), variables('mappedName'))[0], tryGet(variables('mappings'), variables('mappedName'))[1]))) )]" + "value": "[if(equals(tryGet(variables('mappings'), variables('mappedName')), null()), map(coalesce(reference(variables('getPECurrentProperties')).outputs.resource.value.properties.customDnsConfigs, createArray()), lambda('dns', lambdaVariables('dns').fqdn)), map( coalesce(reference(variables('getPECurrentProperties')).outputs.resource.value.properties.customDnsConfigs, createArray()), lambda( 'dns', if(equals(tryGet(variables('mappings'), variables('mappedName'))[2], 'partial'), replace(lambdaVariables('dns').fqdn, tryGet(variables('mappings'), variables('mappedName'))[0], tryGet(variables('mappings'), variables('mappedName'))[1]), if(equals(tryGet(variables('mappings'), variables('mappedName'))[2], 'full'), tryGet(variables('mappings'), variables('mappedName'))[1], lambdaVariables('dns').fqdn)))))]" }, "dnsZoneGroupName": { "value": "[parameters('dnsZoneGroupName')]" diff --git a/policyDefinitions/Network/configure-private-endpoint-to-use-private-dns-zones-generic/azurepolicy.rules.json b/policyDefinitions/Network/configure-private-endpoint-to-use-private-dns-zones-generic/azurepolicy.rules.json index 0da296b2..697eb443 100644 --- a/policyDefinitions/Network/configure-private-endpoint-to-use-private-dns-zones-generic/azurepolicy.rules.json +++ b/policyDefinitions/Network/configure-private-endpoint-to-use-private-dns-zones-generic/azurepolicy.rules.json @@ -107,7 +107,13 @@ "mappings":{ "microsoft.keyvault/vaults/vault" : [ ".vault.", - ".vaultcore." + ".vaultcore.", + "partial" + ], + "Microsoft.Cache/RedisEnterprise/redisEnterprise" : [ + ".redis.azure.net", + ".redis.azure.net", + "full" ] } }, @@ -164,7 +170,7 @@ "value": "[parameters('location')]" }, "customDnsConfigs": { - "value": "[if(equals(tryGet(variables('mappings'), variables('mappedName')), null()), map(coalesce(reference(variables('getPECurrentProperties')).outputs.resource.value.properties.customDnsConfigs, createArray()), lambda('dns', lambdaVariables('dns').fqdn)), map(coalesce(reference(variables('getPECurrentProperties')).outputs.resource.value.properties.customDnsConfigs, createArray()), lambda('dns', replace(lambdaVariables('dns').fqdn, tryGet(variables('mappings'), variables('mappedName'))[0], tryGet(variables('mappings'), variables('mappedName'))[1]))) )]" + "value": "[if(equals(tryGet(variables('mappings'), variables('mappedName')), null()), map(coalesce(reference(variables('getPECurrentProperties')).outputs.resource.value.properties.customDnsConfigs, createArray()), lambda('dns', lambdaVariables('dns').fqdn)), map( coalesce(reference(variables('getPECurrentProperties')).outputs.resource.value.properties.customDnsConfigs, createArray()), lambda( 'dns', if(equals(tryGet(variables('mappings'), variables('mappedName'))[2], 'partial'), replace(lambdaVariables('dns').fqdn, tryGet(variables('mappings'), variables('mappedName'))[0], tryGet(variables('mappings'), variables('mappedName'))[1]), if(equals(tryGet(variables('mappings'), variables('mappedName'))[2], 'full'), tryGet(variables('mappings'), variables('mappedName'))[1], lambdaVariables('dns').fqdn)))))]" }, "dnsZoneGroupName": { "value": "[parameters('dnsZoneGroupName')]"