2016-07-20 23 views
1

我想从Azure-Cli(版本0.10.2)部署documentDb,因此我直接从Azure门户导出模板。需要ARM模板“type”属性

这导致了一个错误:

InvalidRequestContent : The request content was invalid and could not be deserialized: 'Could not find member 'defaultValue' on object of type 'DeploymentParameterDefinition'. Path 'properties.parameters.arm_document_db.defaultValue'

中的“价值”的结果改变这些:

InvalidDeploymentParameterType : The type of deployment parameter 'arm_document_db' should not be specified. Please see https://aka.ms/arm-deploy/#parameter-file for details.

检查此页面指示,要求类型,但都是小写。这给了同样的错误。

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

InvalidRequestContent : The request content was invalid and could not be deserialized: 'Required property 'type' not found in JSON. Path '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链接将显示“类型”是必需的,但是错误说,事实并非如此。提前谢谢了!

回答

0

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