Search code examples
azureazure-resource-managerazure-rm-template

Azure ARM Unexpected character encountered while parsing value [


I've changed my ARM parameters ("Microsoft.Network/virtualNetworks") to include multiple prefixes , but now I am getting the InvalidJson error with message "Unexpected character encountered while parsing value: [. Path 'properties.addressSpace.addressPrefixes', line 1, position 71."

..."parameters": {        
        "addressPrefix": {
            "value": [ 
                "10.18.0.0/17",
                "10.90.0.0/19"
            ]
          },...

the corresponding part of template is shown below

..."properties": {
          "addressSpace": {
            "addressPrefixes": [
              "[parameters('addressPrefix')]"
            ]
          },...

Not sure why it happens because I have similar construct for "Microsoft.Network/localNetworkGateways"


Solution

  • Change the template so that the array in the parameter value is assigned directly to the addressPrefixes property instead of the array of the property.

    ..."properties": {
              "addressSpace": {
                "addressPrefixes": "[parameters('addressPrefix')]"
              },...