0
votes

Trying to build an ARM template to deploy multiple VM. However, the template validation fails with below error message

Deployment template validation failed: 'The resource 'Microsoft.Network/networkInterfaces/sqlnodeNic' is not defined in the template. Please see https://aka.ms/arm-template for usage details.'.

{

      "type": "Microsoft.Network/networkInterfaces",
      "apiVersion": "2015-06-15",
      "location": "[resourceGroup().location]",
      "name": "[concat(variables('sqlNodeNicName'),copyIndex())]",
      "dependsOn": [
        "[resourceId('Microsoft.Network/virtualNetworks',variables('vnetname'))]",
        "[concat('Microsoft.Network/publicIPAddresses/', concat(variables('PiPName'),copyIndex()))]"
      ],
      "tags": {
        "displayName": "[concat(variables('sqlNodeNicName'),copyIndex())]"
      },
      "properties": {
        "ipConfigurations": [
          {
            "name": "[concat('ipconfig1',copyIndex())]",
            "properties": {
              "privateIPAllocationMethod": "Dynamic",
              "subnet": {
                "id": "[variables('sqlNodeSubnetRef')]"
              },
              "publicIPAddress": {
                "id": "[concat('Microsoft.Network/publicIPAddresses/', concat(variables('PiPName'),copyIndex()))]"
              }
            }
          }
        ]
      },
      "copy": {
        "name": "nicCopy",
        "count": "[variables('VmCount')]"
      }
    },
1

1 Answers

0
votes

I wouldn't be able to tell you where the error is given the snippet (it doesnt show where the problem occurs), but looking at this snippet you are generating name in the format: variable+index, while the error suggest some resource is looking for the nic called sqlnodenic which obviously doesnt match the name you are using