【问题标题】:ARM template deploy generating conflict error for traffic managerARM 模板部署为流量管理器生成冲突错误
【发布时间】:2019-10-15 03:55:02
【问题描述】:

我参加了一个项目,该项目通过模板进行了 ARM 部署,运行了几个月,直到最近一切正常:

Successful deployments

但随后,某些东西发生了变化,大多数(但不是全部)部署开始失败:

Unsuccessful deployments

报错是:

{  
 "code": "Conflict",
 "message": "Conflicting changes were detected when processing the request. This can happen when there are multiple requests trying to update one profile at the same time. Please retry your request."
}

然而,这是当时唯一运行的部署。现在我已经设法通过在流量管理器资源中添加dependsOn 来避免这个问题:

{
  "apiVersion": "2015-11-01",
  "type": "Microsoft.Network/trafficManagerProfiles",
  "name": "[variables('traffic-manager-name')]",
  "location": "global",
  "properties": {
    "profileStatus": "Enabled",
    "trafficRoutingMethod": "Priority",
    "dnsConfig": {
      "relativeName": "[variables('traffic-manager-name')]",
      "ttl": 30
    },
    "monitorConfig": {
      "protocol": "HTTP",
      "port": 80,
      "path": "/"
    },
    "endpoints": [
      {
        "name": "[variables('traffic-manager-endpoint')]",
        "type": "Microsoft.Network/trafficManagerProfiles/azureEndpoints",
        "properties": {
          "endpointStatus": "Enabled",
          "targetResourceId": "[resourceId('Microsoft.Web/sites', variables('web-app-name'))]",
          "target": "[concat(variables('web-app-name'), '.azurewebsites.net')]",
          "weight": 1,
          "priority": 1,
          "endpointLocation": "[resourceGroup().location]"
        }
      }
    ]
  },
  "dependsOn": [
    "[resourceId('Microsoft.Web/Sites', variables('web-app-name'))]"
  ]
}

但我担心这样做可能只是混淆了一个仍然需要解决的真正问题。如果有人知道更多关于这个错误的信息,或者它为什么突然开始发生,我很想知道!

【问题讨论】:

    标签: azure-resource-manager azure-deployment azure-template


    【解决方案1】:

    使用 ARM 模板部署流量管理器时,返回 409 冲突错误“处理请求时检测到冲突更改。当有多个请求同时尝试更新一个配置文件时,可能会发生这种情况时间。请重试您的请求。”,因为 ARM 模板部署旨在创建新资源,因此它使用 PUT 请求。如果流量管理器配置文件已经存在,它将在模板进行更改或影响现有配置文件时返回。在部署之前,创建了一个流量管理器,因此模板失败并出现冲突错误。要解决或克服该问题,请确保在 ARM 部署之前未创建任何 TM 配置文件。然后重新测试部署。

    希望这会有所帮助!干杯!

    【讨论】:

    • 感谢您的建议,但是流量管理器已经存在了几个月,部署“覆盖”它没有问题。我试图弄清楚为什么突然间,这停止工作,我们开始发生冲突。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-14
    相关资源
    最近更新 更多