title: Parameters as array copy() not working in resource
body: <p>I am trying to send array of email values as parameters and trying to deploy 'Action group' using 'Copy' in the resource template .My Action group template is getting deployed without errors but email fields are empty. I was passing two email values as parameters. I'm stuck with this for a day. It would be great if someone throw some lights on where i am going wrong.</p>
  
  <p>Template.json:</p>
  
  <pre><code>{
  "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
      "actionGroupName": {
          "type": "string",
          "defaultValue": "newActionGroup",
          "metadata": {
              "description": "Unique name (within the Resource Group) for the Action group."
          }
      },
      "actionGroupShortName": {
          "type": "string",
          "defaultValue": "newActionGroup",
          "metadata": {
              "description": "Short name (maximum 12 characters) for the Action group."
          }
      },
      "emailReceiverName": {
          "type": "array",
          "metadata": {
              "description": "email receiver service Name."
          }
      },
      "emailReceiverAddress": {
          "type": "array",
          "metadata": {
              "description": "email receiver address."
          }
      }
  },
  "variables": {
      "customemailReceiverName": "[array(parameters('emailReceiverName'))]",
      "customemailReceiverAddress": "[parameters('emailReceiverAddress')]"
  },
  "resources": [
      {
          "type": "Microsoft.Insights/actionGroups",
          "name": "[parameters('actionGroupName')]",
          "apiVersion": "2018-03-01",
          "location": "Global",
          "properties": {
              "groupShortName": "[parameters('actionGroupShortName')]",
              "copy": [
                  {
                      "name": "counts",
                      "count": "[length(parameters('emailReceiverName'))]",
                      "input": {
                          "emailReceivers": [
                              {
                                  "name": "[parameters('emailReceiverName')[copyIndex('counts')]",
                                  "emailAddress": "[parameters('emailReceiverAddress')[copyIndex('counts')]]"
                              }
                          ]
                      }
                  }
              ]
          }
      }
  ] }
  </code></pre>
  
  <p>Parameter.json:</p>
  
  <pre><code>{
      "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
          "actionGroupName": {
              "value": "actiongroupslb"
          },
          "actionGroupShortName": {
              "value": "agSLB"
          },
          "emailReceiverName": {
              "value": ["siva","siva1"]
          },
          "emailReceiverAddress": {
              "value": ["siva@gmail.com","svaji@gmail.com"]
          }
  
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6fct3.png" rel="nofollow noreferrer">Action group created with missing email values</a></p>