title: How to replace an array in Azure template?
body: <p>I have "onprem' array in templates parameters</p>
  
  <pre><code>"onprem":{
              "value":  [
                  "1.1.1.0/16",
                  "2.2.2.0/16"
                ]     
          }
  </code></pre>
  
  <p>and want to replace this in the template</p>
  
  <pre><code>"localNetworkAddressSpace": {
              "addressPrefixes":  [
                "1.1.1.0/16",
                "2.2.2.0/16"
              ]          
            }
  </code></pre>
  
  <p>The below gives me an error</p>
  
  <pre><code>"localNetworkAddressSpace": {
              "copy": [{
                "name": "onpremBase",
                "count": "[length(parameters('onprem'))]",
                "input": {
                    "addressPrefixes": "[parameters('onprem')[copyIndex('onpremBase')]]"                               
                }
            }]  
  </code></pre>