Azure / azure-devtestlab

Azure DevTestLab artifacts, scripts and samples
MIT License
458 stars 602 forks source link

Portal does not set the default value of bool parameters if it is false #797

Open Yvand opened 3 years ago

Yvand commented 3 years ago

When creating an environment from an ARM template using the DevTest Labs portal, the default value of bool parameters is not set if defaultValue is false (it works fine if defaultValue is true).

This example allows to reproduce the issue:

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "boolParam1": {
      "type": "bool",
      "defaultValue": true,
      "metadata": {
        "description": "Portal will set the default value to true as expected."
      }
    },
    "boolParam2": {
      "type": "bool",
      "defaultValue": false,
      "metadata": {
        "description": "Portal will not set the default value."
      }
    }
  },
  "variables": {
  },
  "resources": [
  ],
  "outputs": {
  }
}

The default value is always set as expected when loading the template with https://portal.azure.com/#create/Microsoft.Template/.

Picture of the issue (parameter boolParam2 is not set): image