According to the best practices defined by Azure, a consistent order of elements in a templates is recommended. This makes it easier to read and understand the template.
Not following this convention has no technical impact, but will reduce the template’s readability because most developers are used to the standard order.
Recommended order of the resource elements:
{
"resources": [
{
"comments": "if any",
"condition": true,
"scope": "% parent scope %",
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2023-09-01",
"name": "resourceName",
"location": "[parameters('location')]",
"zones": [],
"sku": {},
"kind": "",
"scale": "",
"plan": {},
"identity": {},
"copy": {},
"dependsOn": [],
"tags": {},
"properties": {}
}
]
}
Any other properties not listed here should be placed before the properties object for the resource.
Recommended order of the resource elements and decorators:
@description @batchSize resource resourceName parent scope name location/extendedLocation zones sku kind scale plan identity dependsOn tags properties
Any other decorated not listed here should be placed before the resource object and after the other decorators. Any other elements not
listed here should be placed before the properties object for the resource.