Skip to content

Add Policy for configuring private dns zones on any private endpoint Improved - with compliance working 100%#529

Merged
neiichango merged 3 commits into
Azure:mainfrom
mitramcc:main
May 20, 2026
Merged

Add Policy for configuring private dns zones on any private endpoint Improved - with compliance working 100%#529
neiichango merged 3 commits into
Azure:mainfrom
mitramcc:main

Conversation

@mitramcc
Copy link
Copy Markdown
Contributor

@mitramcc mitramcc commented Mar 31, 2026

The built-in policies we have besides being 1 policy for each serive the compliance doesn't work as expected.
If we delete the record from portal the compliance doesn't change therefore you might end up with resouces non-compliant marked as compliant.
This policy solves that problem and the different number of DNS records for the same resource type e.g: Open AI and AI Foundry

The logic of the policy is to take the customDnsRecors and from there choose which private DNS zone name to use.
There are some resources that don't folow this logic E.g: Key Vault uses privateDNS Zone : privatelink.vaultcore.azure.net but CustomDNSRecord is xxxxx.vault.azure.net
In this case we have to add mappings in the template part as I did for AKV.
Lowercase values for the key of the object to be added followed by an array with 2 items, first the forward part that we are going to replace , then the value that we will replace with:
Example
"mappings":{
"microsoft.keyvault/vaults/vault" : [
".vault.",
".vaultcore."
]
}

@neiichango neiichango self-assigned this Apr 22, 2026
@neiichango
Copy link
Copy Markdown
Collaborator

policy works fine on greenfield and brownfield tests

@Joshua-Donovan
Copy link
Copy Markdown
Collaborator

quick syntax review and no issues found, with @neiichango already validating functionality I agree with a merge for this one.

@neiichango neiichango merged commit 33279a9 into Azure:main May 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants