Share via

Manage Azure private dns zone A entries TTL via Azure Policy

stephane clavel 66 Reputation points
2026-04-01T15:14:50.7366667+00:00

Hi

Is it possible to manage Azure private dns zone A entries TTL via Azure Policy please?

The following if condition does not catch any A entry for which TTL is different to 600.

"policyRule":{

  "if":{

     "allOf":[

        {

           "field":"type",

           "equals":"Microsoft.Network/privateDnsZones/A"

        },

        {

           "field":"Microsoft.Network/privateDnsZones/A/Ttl",

           "notEquals":600

        }

     ]

  },

  "then":{

Thanks

Azure Policy
Azure Policy

An Azure service that is used to implement corporate governance and standards at scale for Azure resources.


Answer accepted by question author

Bharath Y P 9,645 Reputation points Microsoft External Staff Moderator
2026-04-03T10:23:34.4666667+00:00

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

Microsoft.Network/privateDnsZones/A - Bicep, ARM template & Terraform AzAPI reference | Microsoft Learn

To use a property in Azure Policy, a policy alias must exist. Aliases can be discovered using:

  • Azure Policy VS Code extension
  • Get-AzPolicyAlias PowerShell 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.ttl is 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.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-04-01T15:15:05.06+00:00

    Azure Policy can evaluate and enforce properties that are exposed on the resource type. For Microsoft.Network/privateDnsZones/A, the TTL is not a top-level field; it is part of the properties object.

    According to the resource schema, the TTL is defined as:

    • properties.ttl (an int in RecordSetProperties)

    and the resource type is:

    • type: Microsoft.Network/privateDnsZones/A

    So the policy condition must target the properties.ttl path, not Microsoft.Network/privateDnsZones/A/Ttl.

    A working if block would look like this (conceptually):

    "if": {
      "allOf": [
        {
          "field": "type",
          "equals": "Microsoft.Network/privateDnsZones/A"
        },
        {
          "field": "Microsoft.Network/privateDnsZones/A/properties.ttl",
          "notEquals": 600
        }
      ]
    }
    

    or, using the generic field path:

    {
      "field": "properties.ttl",
      "notEquals": 600
    }
    

    Using the correct property path allows Azure Policy to match A record sets whose TTL differs from 600 and then audit or deny them as required.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.