azure - 错误:部署参数使用区分大小写的名称。错误参数名称:名称。(ARM 模板部署)
问题描述
我正在为创建路由表创建 ARM 模板。从模板部署下载的简单 ARM 模板失败。在我运行 ARM 模板后,它会询问名称并引发以下错误。
我曾尝试给出 routeVnet、vnetroute 等名称。看到一些帖子在名称中给出小写大写的组合将解决问题。但它在这里不起作用。
手臂模板:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.5",
"parameters": {
"name": {
"type": "string"
},
"location": {
"type": "string"
},
"tagsByResource": {
"type": "object",
"defaultValue": {},
"metadata": {
"description": "Optional tags provided by the user via createUiDefinition.json"
}
},
"disableBgpRoutePropagation": {
"type": "bool"
}
},
"variables": {},
"resources": [
{
"apiVersion": "2019-02-01",
"type": "Microsoft.Network/routeTables",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"tags": "[ if(contains(parameters('tagsByResource'), 'Microsoft.Network/routeTables'), parameters('tagsByResource')['Microsoft.Network/routeTables'], json('{}')) ]",
"properties": {
"disableBgpRoutePropagation": "[parameters('disableBgpRoutePropagation')]"
}
}
],
"outputs": {}
}
参数模板:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"value": "eastus"
},
"Name": {
"value": ""
},
"tagsByResource": {
"value": {}
},
"disableBgpRoutePropagation": {
"value": true
}
}
}
解决方案
问题在于您将参数名称作为 "Name"传递的参数文件,在模板中您的参数是名称,而在参数文件中您将其称为Name。
正确的参数文件如下所示:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"value": "eastus"
},
"name": {
"value": "routeVnet12"
},
"tagsByResource": {
"value": {}
},
"disableBgpRoutePropagation": {
"value": true
}
}
}
推荐阅读
- java - 有没有办法用 osmdroid 激活标签?
- android - 在 Android 上应用 StrictMode 时出现 setUidCleartextNetworkPolicy 上的 IllegalStateException
- node.js - 以管理员身份启动节点 js 子进程
- hive - 在外部 Hive 表 (Hive 2.3.6) 上执行 MSCK REPAIR TABLE 时出错
- azure - 使用图形 API 和登录名作为用户名创建用户时,Azure AD B2C 密码重置不起作用
- jasper-reports - 无法将数据从主报告传递到报告中的子报告
- android - Android将数据发送到另一个应用程序的后台服务
- c++ - 如何在 qml 中通过父组件设置 C++ 模型?
- c++ - UE4 项目链接错误,描述为空
- ios - iOS:iOS 目标中的 tvOS API 可用性错误 | 迅捷包