代码之家  ›  专栏  ›  技术社区  ›  Cristian E.

dnsnameLabelNotSupported-用于Azure容器实例的vsts ARM模板

  •  0
  • Cristian E.  · 技术社区  · 7 年前

    基本上在添加 "dnsNameLabel" 对于我的ARM模板对于Azure容器实例的值,我收到以下消息:

    2018-07-03T14:31:14.8518944Z ##[error]At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.
    2018-07-03T14:31:14.8571875Z ##[error]Details:
    2018-07-03T14:31:14.8616789Z ##[error]BadRequest: {
      "error": {
        "code": "DnsNameLabelNotSupported",
        "message": "DNS name label for container group is not supported before version '2018-02-01-preview'."
      }
    }
    

    摘自arm-template.json

    ...
                "osType": "[variables('osType')]",
                "ipAddress": {
                    "type": "Public",
                    "dnsNameLabel": "rabbitmq",
                    "ports": [
                        {
                            "protocol": "tcp",
                            "port": "15672"
                        }
                    ]
                },
    ...
    

    另外,我正在使用VSTS的Azure资源组部署任务进行部署。

    1 回复  |  直到 7 年前
        1
  •  1
  •   Cristian E.    7 年前

    问题是由 "apiVersion" 输入ARM模板文件。它必须被更新以匹配API的新版本。导航到 github arm templates repo 你可以看到哪个是最新的版本。

    更新到最新版本解决了问题。

    另一个建议是使用JSON模式验证器来确保.json文件的内容与模式匹配。

    推荐文章