【问题标题】:ARM Template 'type' property required需要 ARM 模板“类型”属性
【发布时间】:2016-07-20 09:17:59
【问题描述】:

我正在尝试从 Azure-Cli(版本 0.10.2)部署一个 documentDb,因此我直接从 azure 门户导出了模板。

这导致了以下错误:

InvalidRequestContent:请求内容无效,无法反序列化:“在“DeploymentParameterDefinition”类型的对象上找不到成员“defaultValue”。路径'properties.parameters.arm_document_db.defaultValue'

将这些更改为“值”会导致:

InvalidDeploymentParameterType :不应指定部署参数“arm_document_db”的类型。详情请见https://aka.ms/arm-deploy/#parameter-file

选中此页面表示该类型是必需的,但都是小写的。这给出了同样的错误。

删除“类型”然后给我这个错误:

InvalidRequestContent :请求内容无效且无法反序列化:在 JSON 中找不到“必需的属性“类型”。路径'properties.template.parameters.arm_document_db'

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
    "arm_document_db": {
        "defaultValue": null,
        "type": "SecureString"
    },
    "arm_document_db01": {
        "defaultValue": "arm-document-db01",
        "type": "String"
    }
},
"variables": {},
"resources": [
    {
        "type": "Microsoft.DocumentDB/databaseAccounts",
        "kind": "DocumentDB",
        "name": "[parameters('arm_document_db01')]",
        "apiVersion": "2015-04-08",
        "location": "Japan West",
        "tags": {},
        "properties": {
            "databaseAccountOfferType": "Standard",
            "name": "[parameters('arm_document_db')]"
        },
        "dependsOn": []
    }
]
}

aka.ms 链接显示“类型”是必需的,但错误表明它不是。非常感谢!

【问题讨论】:

    标签: azure-cli


    【解决方案1】:

    该错误不适用于 azuredeploy.json。它用于 azuredeploy.parameters.json。 从参数文件中删除“类型”字段。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多