参数文件:模板验证失败:在JSON中找不到必需的属性'type'

问题描述 投票:0回答:2

从此处使用ARM模板:https://raw.githubusercontent.com/elastic/azure-marketplace/7.6.0/src/mainTemplate.json

为通过terraform进行ARM模板部署创建了一个参数文件(仅片段,实际还有更多参数:

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json##",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "_artifactsLocation": {
      "value": "https://raw.githubusercontent.com/elastic/azure-marketplace/7.6.0/src/"
    },
    "_artifactsLocationSasToken": {
      "value": ""
    },
    "esVersion": {
      "value": "${esVersion}"
    },
    "esClusterName": {
      "value": "${esClusterName}"
    },
    "loadBalancerType": {
      "value": "external"
    },
    "loadBalancerInternalSku": {
      "value": "Basic"
    }
  }
}

错误消息:模板验证失败:在JSON中找不到必需的属性'type'。路径'parameters._artifactsLocation',第7行,位置5。“

我们需要在参数文件中指定属性“类型”吗?

azure azure-devops arm-template
2个回答
0
投票

否,解决此问题:

"_artifactsLocation": {
    "value": "https://raw.githubusercontent.com/elastic/azure-marketplace/7.6.0/src/"
},

0
投票

已修复:

不需要以下参数:

  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json##",
  "contentVersion": "1.0.0.0",
  "parameters": {

删除它们后,不再有模板验证失败。一些参数文件不需要这些头。

参考:https://github.com/Azure/azure-sdk-for-python/issues/482

© www.soinside.com 2019 - 2024. All rights reserved.