For ARM templates, enforce deterministic JSON formatting and standardized property ordering to keep diffs small and templates readable.
Rules
- Keep property order consistent: follow the Azure “sort order of properties” guidance (move keys to the expected order).
- Prefer multi-line formatting: format arrays and nested objects across multiple lines (avoid single-line arrays/objects that can be rewritten differently by tooling).
- Trim safely for readability: remove redundant fields only when it won’t break the schema/deployment (don’t delete required properties).
- Avoid formatting tool churn: don’t rely on editors/formatters that collapse arrays/objects into single-line forms; apply the team’s formatting rules consistently.
Example (safe trimming + multi-line style)
"subnets": [
{
"name": "subnet",
"properties": {
"addressPrefix": "192.168.0.0/24"
}
}
]
Apply the same formatting style across all templates, and reorder top-level/nested properties to match the prescribed ARM sort order before merging.