An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
Hi @K, Niranjan ,
When working with Azure PaaS services, Private Endpoints, and Private DNS Zones, a Policy deployment issue typically stems from a misalignment between your centralised Azure Policy definitions (like DeployIfNotExists or Modify) and the way your private endpoint resources or network topologies are being provisioned.
If your Azure Policy is failing to map or create DNS records for your Private Endpoints, it is usually caused by one of these common root causes:
- Permissions or RBAC Issues on the Managed Identity The DeployIfNotExists (DINE) policy utilizes a Managed Identity to create the Network/privateDnsZones/dnsZoneGroups resource. Issue: The policy's managed identity lacks the Private DNS Zone Contributor or Network Contributor role over the central resource group where your Private DNS Zones live. Fix: Go to your Azure Policy Assignment, check its Identity tab, and verify that the assignment has been granted proper RBAC permissions at the scope of your central DNS zones.
- Conflicting "Integrate with Private DNS" Settings during Manual Creation Issue: If user manually creates a Private Endpoint via the Azure Portal and selects "Yes" to Integrate with private DNS zone, the portal will attempt to create a local Private DNS Zone in that same resource group. If an Azure Policy is set up to Deny local zone creation (forcing everything to use a central hub zone), the deployment will fail. Fix: When manually deploying Private Endpoints under strict governance, always select "No" to Integrate with private DNS zone. Let the background DeployIfNotExists policy step in post-deployment to handle the centralized mapping.
To properly route traffic to PaaS services securely without passing over the public internet, use the following architectural workflow:
Step 1: Create the Central Private DNS Zones
Azure requires specific zone naming conventions for its CNAME redirection mechanism to work.
- In your hub or identity subscription, create a Private DNS Zone.
- Match the name precisely to the service type. Common examples include:
Azure Blob Storage: privatelink.blob.core.windows.net
Azure SQL Database: privatelink.database.windows.net
Azure Key Vault: privatelink.vaultcore.azure.net
Step 2: Link the Private DNS Zone to Your VNets
A Private DNS Zone is completely isolated until it is explicitly associated with a virtual network.
- Navigate to your created Private DNS Zone.
- Under Settings, select Virtual network links.
- Click + Add, select your target Virtual Network (where your client VMs, AKS clusters, or App Services reside), and save.
Step 3: Deploy the PaaS Private Endpoint
- Go to your PaaS resource (e.g., your Storage Account).
- Select Networking > Private endpoint connections > + Private Endpoint.
- Choose the target VNet and Subnet where the endpoint's private IP should be allocated.
- Under Configuration, if you are letting a central Azure Policy handle it, toggle Integrate with private DNS zone to No. If configuring manually without a policy, select Yes and point it to the central zone created in Step 1.
Step 4: Configure the dnsZoneGroups
The dnsZoneGroup is a sub-resource of the Private Endpoint that links it directly to the Private DNS Zone, instructing Azure to automatically populate and maintain the A record.
Once configured it would be as in the below format.
{
"type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups",
"apiVersion": "2023-11-01",
"name": "[concat(parameters('privateEndpointName'), '/default')]",
"properties": {
"privateDnsZoneConfigs": [
{
"name": "config1",
"properties": {
"privateDnsZoneId": "[parameters('privateDnsZoneResourceId')]"
}
}
]
}
}
To confirm that your mapping issue is resolved, spin up a test machine inside your linked Virtual Network and run a command-line DNS lookup:
nslookup myserver.database.windows.net