How Properties keys map into the definition, and their defaults¶
Context and Problem Statement¶
Properties @{ } accepts DisplayName, Description, Category, Version, Mode, Preview, Deprecated and Metadata. Where does each key go, which keys are required, and what are the defaults? Azure has also added a top-level version property for custom policy versioning, which is in preview, alongside the customary metadata.version.
Considered Options¶
Versionmaps tometadata.versiononly, andModedefaults toAllVersionmaps to bothmetadata.versionandproperties.version- No default
Mode(it must be set)
Decision Outcome¶
Chosen option: "Version maps to metadata.version only, and Mode defaults to All".
| Key | Emitted as | Required | Validation |
|---|---|---|---|
DisplayName |
properties.displayName |
yes | 1 to 128 characters |
Description |
properties.description |
no | at most 512 characters |
Mode |
properties.mode |
no, defaults to All |
All or Indexed, ignoring case, emitted as All or Indexed |
Version |
metadata.version |
no | SemVer major.minor.patch, optionally with a -preview or -deprecated suffix |
PolicyVersion |
properties.version, plain JSON only |
no | major.minor.patch, optionally with -preview, as Learn gives it. EPAC output reports BYL4013. |
Category |
metadata.category |
no | string |
Preview |
metadata.preview |
no | boolean |
Deprecated |
metadata.deprecated |
no | boolean |
Metadata |
merged into metadata |
no | hashtable. A key that clashes with a generated key (version, category, preview, deprecated) is an error, and so is deployedBy (ADR-0011). Each value is at most 1024 characters once serialised. |
- Unknown keys fail the build. The error lists the valid keys and suggests the closest match.
- Resource provider modes (such as
Microsoft.Kubernetes.Data) are not supported in language version 1.0. They have different rule and effect requirements and would need their own ADR. Allis the default because it is what Azure PowerShell uses. Policies on tags or location usually wantIndexed, so the compiler warns whenModeisAlland the rule referencestagsorlocation.- The top-level
properties.versionwas at first not emitted, because custom policy versioning is still in preview. On 2026-11-28PolicyVersionwas added for it, as a key of its own rather than a second use ofVersion: the Azure Landing Zones Library has initiatives whose top-level version (1.0.0) differs frommetadata.version(1.1.0), so one key can't express both (ADR-0042). Only plain JSON output writes it: EPAC's schemas don't have a top-levelversion, and its initiative schema forbids other properties. Initiative members that pin-Versionare checked againstPolicyVersionwhen the policy has one (BYL3126), and otherwise warned that the pin may not select the version expected (BYL3129). -deprecatedwas added beside-previewon 2026-11-28 (Milestone 5): Azure's versioning convention marks retired definitions with it, as the built-in policies and 56 of the Azure Landing Zones Library's definitions do (ADR-0042).
Consequences¶
- Good, because the output follows established built-in policy conventions.
- Good, because
PolicyVersionlets plain JSON output use Azure's preview versioning, without changing whatVersionmeans. - Bad, because EPAC output can't use it until EPAC's schemas do.
Confirmation¶
Unit tests cover each key, each validation rule and the defaults.