Skip to content

Default should match type#

Set the parameter default value to a value of the same type.

Description#

Azure Resource Manager (ARM) template support parameters with a range of types, including:

  • bool
  • int
  • string
  • array
  • object
  • secureString
  • secureObject

When including a defaultValue, the default value should match the same type at the type property. For example:

{
  "boolParam": {
    "type": "bool",
    "defaultValue": false
  },
  "intParam": {
    "type": "int",
    "defaultValue": 5
  },
  "stringParam": {
    "type": "string",
    "defaultValue": "test-rg"
  },
  "arrayParam": {
    "type": "array",
    "defaultValue": [ 1, 2, 3 ]
  },
  "objectParam": {
    "type": "object",
    "defaultValue": {
      "one": "a",
      "two": "b"
      }
  }
}

Recommendation#

Consider updating the parameter default value to a value of the same type.


Last update: 2021-09-15