Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARM template, Incorrect Segment Lengths

I'm trying to build an ARM template and keep getting the error:

'The template resource 'udr-sub-w05-w05-w05-agw-10.10.10.32/27' for type 
'Microsoft.Network/routeTables' at line '141' and column '5' has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must 
have segment length one greater than its resource name.

The nested template for create route tables code is below:

{
      "name": "[variables('routeTable1')]",
      "type": "Microsoft.Network/routeTables",
      "apiVersion": "[variables('routeTableApiVersion')]",
      "location": "[resourceGroup().location]",
      "properties": {
        "routes": [
        ],
        "disableBgpRoutePropagation": false
      }
    },
    {
      "name": "[variables('routeTable2')]",
      "type": "Microsoft.Network/routeTables",
      "apiVersion": "[variables('routeTableApiVersion')]",
      "location": "[resourceGroup().location]",
      "properties": {
        "routes": [
        ],
        "disableBgpRoutePropagation": false
      }
    },

Any idea where this is going wrong? I've spent some time googling and my understanding is the "TYPE" should have one less segment than the "NAME", which I believe it has

  "name": "[variables('routeTable1')]",
  "type": "Microsoft.Network/routeTables",

Route table one variables

 "routeTable1": "[tolower(concat('udr-', variables('subnetName1')))]",
 "routeTable2": "[tolower(concat('udr-', variables('subnetName2')))]",

Thanks

like image 557
Norrin Rad Avatar asked Oct 30 '18 23:10

Norrin Rad


1 Answers

Your route table name contains /, hence it thinks you are trying to create a sub resource and asks you to provide its type (you only provide parent resource type). remove the /27 thing or replace it with -27 or something like that.

like image 58
4c74356b41 Avatar answered Nov 02 '22 05:11

4c74356b41