Skip to content

Use comments for each generated template resource#

Operational Excellence · All resources · Rule · 2021_12 · Awareness

Use descriptions for each resource in generated template(bicep, psarm, AzOps) to communicate purpose.


Generated templates can optionally include descriptions in resources. This helps other contributors understand the purpose of the resource.


Specify descriptions for each resource in the template.


Configure with Bicep#

To define Bicep template files that pass this rule:

  • Specify the @description() or @sys.description() decorator for each resource in the template.

For example:

Azure Bicep snippet
// An example container registry
resource acr 'Microsoft.ContainerRegistry/registries@2021-06-01-preview' = {
  name: registryName
  location: location
  sku: {
    name: 'Premium'
  identity: {
    type: 'SystemAssigned'
  properties: {
    adminUserEnabled: false
    policies: {
      quarantinePolicy: {
        status: 'enabled'
      trustPolicy: {
        status: 'enabled'
        type: 'Notary'
      retentionPolicy: {
        status: 'enabled'
        days: 30