Skip to content

Use ARM template file structure#

Operational Excellence · All resources · Rule · 2020_06 · Important

Use ARM template files that are valid.

Description#

Azure Resource Manager (ARM) template files have a pre-defined structure. ARM templates require $schema, contentVersion and resources sections to be defined. If any of these sections are missing, ARM will not accept the template.

Recommendation#

Consider reviewing the requirements for this file. Also consider using Visual Studio Code to assist with authoring these files.

Examples#

Configure with Azure template#

To define Azure template files that pass this rule:

  • Always specify the required properties $schema, contentVersion and resources properties.
  • Optional specify languageVersion, definitions, metadata, parameters, functions, variables, and outputs properties.
  • Avoid specifying any other properties.

For example:

Azure Template snippet
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": { },
  "variables":  { },
  "resources": [ ]
}

Notes#

This rule is not applicable to Azure Bicep files as they have a different structure. If you are running analysis over pre-built Bicep files and they generate a rule failure, please raise an issue.

Comments