Skip to content

Use parameter file metadata link#

Operational Excellence · All resources · Azure.Template.MetadataLink

Configure a metadata link for each parameter file.

Description#

A parameter file can include an additional metadata. This metadata provides additional context for use of the parameter file.

PSRule for Azure uses the metadata.template property within parameter files to store a metadata link. A metadata link, is an explicit association between a parameter file it's intended template file.

This rule is disabled by default but can be enabled by configuring AZURE_PARAMETER_FILE_METADATA_LINK. Enable this rule to ensure that each parameter file has a metadata link to a valid template file.

Recommendation#

Consider setting metadata for each parameter file linking to the deployment template.

Examples#

Configure parameter file#

To create parameter files that pass this rule:

  • Set the metadata.template property to a valid template file path.

For example:

{
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "metadata": {
        "template": "templates/storage/v1/template.json"
    },
    "parameters": {
        "storageAccountName": {
            "value": "..."
        }
    }
}

Notes#

Enable this rule by setting the AZURE_PARAMETER_FILE_METADATA_LINK option to true.


Last update: 2021-10-19