azure - ARM 模板,段长度不正确

标签 azure azure-resource-manager azure-rm-template

我正在尝试构建 ARM 模板并不断收到错误:

'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.

创建路由表代码的嵌套模板如下:

{
      "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
      }
    },

知道哪里出了问题吗?我花了一些时间谷歌搜索,我的理解是“TYPE”应该比“NAME”少一个段,我相信它有

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

路由表一变量

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

谢谢

最佳答案

您的路由表名称包含 /,因此它认为您正在尝试创建子资源并要求您提供其类型(您只提供父资源类型)。删除 /27 内容或将其替换为 -27 或类似内容。

关于azure - ARM 模板,段长度不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53074116/

相关文章:

azure - 使用 MS Graph API 在 ADB2C 中重置没有 Directory.AccessAsUser.All 权限的用户密码

azure - 从 ARM 模板中的 Azure key 保管库获取最新版本的证书

azure - 如何将“拒绝分配”置于 Azure 订阅或资源组级别?

asp.net - Azure 媒体播放器 Silverlight 后备不起作用

Azure 应用程序网关排除 - 检查嵌套请求正文属性

azure - 在 Windows Azure 中创建表时出现 "The value for one of the HTTP headers is not in the correct format"

azure - ARM 资源迭代因空数组而失败

terraform - 如何使用 terraform 0.13.5 检查列表中是否存在该值?

azure - 将可用性集添加到 Azure 虚拟机模板创建

azure - 如何有条件地在 ARM 模板中包含 dependentOn