title: ARM template deploy generating conflict error for traffic manager
body: <p>I have come onto a project that has had an ARM deployment via templates running for a number of months now, and until recently everything was working without issue:</p>
  
  <p><a href="https://i.stack.imgur.com/a4orB.png" rel="nofollow noreferrer">Successful deployments</a></p>
  
  <p>But then, <em>something</em> changed and most (but not all) deployments began failing:</p>
  
  <p><a href="https://i.stack.imgur.com/jlyUG.png" rel="nofollow noreferrer">Unsuccessful deployments</a></p>
  
  <p>The error reported is:</p>
  
  <pre><code>{  
   "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."
  }
  </code></pre>
  
  <p>Yet this is the only deploy running at the time. For now I've managed to stave off the issue by adding a <code>dependsOn</code> to the traffic manager resource:</p>
  
  <pre><code>{
    "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'))]"
    ]
  }
  </code></pre>
  
  <p>But I am concerned that doing so may simply be obfuscating a genuine issue that still needs addressing. If anyone knows any more about that error, or why it might have just started happening out of nowhere, I'd love to know!</p>