0
votes

I have an ARM template which attempts to set up firewall rules for an Azure Data Lake Store based on an array of firewall parameters. The parameter list for the IP rules is distinct, there is no duplication, however the template reports duplicates when I try deploy.

Any idea where it is going wrong or how to troubleshoot further?

Properties of the Azure Data Lake Store (in the ARM template)

"copy": [
      {
        "name": "firewallRules",
        "count": "[length(parameters('firewallRules'))]",
        "input": {
          "name": "[parameters('firewallRules')[copyIndex('firewallRules')].name",
          "properties": {
            "startIpAddress": "[parameters('firewallRules')[copyIndex('firewallRules')].startIp]",
            "endIpAddress": "[parameters('firewallRules')[copyIndex('firewallRules')].endIp]"
          }
        }
      }
    ]

Error Message:

[ERROR] New-AzureRmResourceGroupDeployment : 18:57:28 - Resource Microsoft.DataLakeStore/accounts 'myadlsname' failed with [ERROR] message '{ [ERROR] "error": { [ERROR] "code": "DuplicatedNestedResource", [ERROR] "message": "There're firewall rules with the same name in Body." [ERROR] } [ERROR] }'

Parameters:

  "FirewallRules": {
          "value": [
            {
              "name": "Allow_1",
              "startIp": "1.1.1.1",
              "endIp": "1.1.1.1"
            },
            {
              "name": "Allow_2",
              "startIp": "2.2.2.2",
              "endIp": "2.2.2.2"
            },
            {
              "name": "Allow_3",
              "startIp": "3.3.3.3",
              "endIp": "3.3.3.3"
            }
          ]
        }
1

1 Answers

1
votes

I think you messed up with the brackets in this line:

"name": "[parameters('firewallRules')[copyIndex('firewallRules')].name",

It should look like:

"name": "[parameters('firewallRules')[copyIndex('firewallRules')].name]",

The last closing bracket is missing. If the brackets does not match the complete expression will not processed. This will result in the same name on the second loop.

Greetings, KirK