An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
Azure Policy cannot directly read arbitrary ARM resource properties. It can only evaluate properties that have a published policy alias. Microsoft documentation states that property aliases are required to reference specific resource properties in a policy rule. If an alias does not exist for a property, Azure Policy cannot access that property at all, even though it exists in the ARM schema. Details of the policy definition structure aliases - Azure Policy | Microsoft Learn
For Azure Private DNS A record sets, the TTL is stored in the ARM schema at properties.ttl
Resource type:
Microsoft.Network/privateDnsZones/A
To use a property in Azure Policy, a policy alias must exist. Aliases can be discovered using:
- Azure Policy VS Code extension
-
Get-AzPolicyAliasPowerShell command - Azure provider alias APIs
When checking the aliases for:
Microsoft.Network/privateDnsZones/A
you will find that no alias exists for properties.ttl.
Example command:
Get-AzPolicyAlias -NamespaceMatch Microsoft.Network
When you attempt to reference:
"field": "properties.ttl"
Azure Policy returns the validation error:
The value of 'field' property properties.ttl must be one of 'Name, Type, Location…' or an alias
This occurs because:
-
properties.ttlis not a supported alias - Azure Policy only allows built-in fields or registered aliases
Therefore the policy definition fails before it can be created.
Troubleshoot common errors - Azure Policy | Microsoft Learn
Azure Policy can evaluate the resource type, because type is a built-in field.
Example:
{
"field": "type",
"equals": "Microsoft.Network/privateDnsZones/A"
}
However, it cannot evaluate the TTL value itself.
At this time, Azure Policy cannot audit, deny, or enforce TTL values for Azure Private DNS A record sets, because:
- TTL exists at
properties.ttl - No Azure Policy alias exists for this property
- Azure Policy cannot evaluate non-aliased properties
Therefore, TTL governance through Azure Policy is not currently supported.