I get "The template resource 'testing' for type 'Microsoft.Network/virtualNetworks/subnets' at line '1' and column '181' has incorrect segment lengths." error message when trying to deploy my ARM template. Any ideas what might be wrong with this?
{
"apiVersion": "2017-08-01",
"name": "nestedTemplate",
"type": "Microsoft.Resources/deployments",
"resourceGroup" : "[variables('ResourceGroupName')]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('NSGName'))]"
],
"properties": {
"mode" : "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"apiVersion" : "2018-03-01",
"type": "Microsoft.Network/virtualNetworks/subnets",
"name": "[parameters('subnetName')]",
"location": "[resourceGroup().location]",
"properties": {
"addressPrefix": "[reference(resourceId(variables('ResourceGroupName'), 'Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('subnetName')), '2018-03-01').addressPrefix]",
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('NSGName'))]"
}
}
},
]
}
}
}