【发布时间】:2019-04-07 17:20:43
【问题描述】:
我想使用 ARM 模板更新带有 swagger 链接的 API 操作。当我运行下面的 ARM 模板时,我得到了错误
"error": { "code": "InvalidRequestContent", "message": "请求 内容无效,无法反序列化:'找不到 “DeploymentPropertiesDefinition”类型的对象上的成员“dependsOn”。 路径 'properties.dependsOn',第 1 行,位置 734.'。”
{
"$schema":
"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"ApimServiceName": {
"type": "string"
},
"swaggerjson": {"type": "string"}
},
"variables": {
},
"resources": [
{
"type": "Microsoft.ApiManagement/service/apis",
"name": "[concat(parameters('ApimServiceName'), '/animalAPI4')]",
"apiVersion": "2018-02-01-preview",
"scale": null,
"properties": {
"displayName": "HTTP animal API",
"apiRevision": "1",
"description": "API Management facade for a very handy and free online HTTP toolsds",
"serviceUrl": "https://animailhttpbin.org",
"path": "animals4",
"contentFormat": "swagger-link-json",
"contentValue": "[parameters('swaggerjson')]",
"apiVersionSet": {
"id": "[concat(resourceId('Microsoft.ApiManagement/service', parameters('ApimServiceName')), '/api-version-sets/versionset-animal-api4')]"
},
"protocols": [
"https"
],
"authenticationSettings": null,
"subscriptionKeyParameterNames": null,
"apiVersion": "v1"
},
"dependsOn": [
]
}
]
}
【问题讨论】:
-
为什么不直接删除
dependsOn属性?另外,根据错误,您在某处的属性下有dependOn -
我已经添加了dependsOn,看看它是否有任何不同,但发生了同样的错误。我添加了 Microsoft.ApiManagement/service/apis 的参考链接。因为在属性中没有dependsOn。
标签: azure azure-resource-manager