Azure-quickstart-templates: 201-Traffic-Manager-WebApp template does not work in Incremental Mode

Created on 25 Aug 2016  路  4Comments  路  Source: Azure/azure-quickstart-templates

201-traffic-manager-webapp

@GarethBradshawMSFT

Issue Details

The template can only be installed once. If the traffic manager is already available, the deployment will fail, even if specifying "Incremental".

The message is the following:

{
  "Code": "BadRequest",
  "Message": "The traffic manager domain (<domainPrefix>.trafficmanager.net) can be removed only through the Traffic Manager.",
  "Target": null,
  "Details": [
    {
      "Message": "The traffic manager domain (<domainPrefix>.trafficmanager.net) can be removed only through the Traffic Manager."
    },
    {
      "Code": "BadRequest"
    },
    {
      "ErrorEntity": {
        "Code": "BadRequest",
        "Message": "The traffic manager domain (<domainPrefix>.trafficmanager.net) can be removed only through the Traffic Manager.",
        "ExtendedCode": "52011",
        "MessageTemplate": "The traffic manager domain ({0}) can be removed only through the Traffic Manager.",
        "Parameters": [
          "<domainPrefix>.trafficmanager.net"
        ],
        "InnerErrors": null
      }
    }
  ],
  "Innererror": null
}

Most helpful comment

@Kennethtruyers; the fix for this is to specify the ATM hostname in the hostname sections of the web app.
It fails otherwise because it assumes you are trying to remove the already existing ATM binding.

`
{
"type": "Microsoft.Web/sites",
"name": "webAppName",
"apiVersion": "2015-08-01",
"location": "webAppLocation",
"copy": {
"name": "websitescopy",
"count": "3"
},
"properties": {
"name": "[toLower(concat('webapp-', parameters('webSiteNames')[copyIndex()]))]",
"hostNames": [
"default.azurewebsites.net"
"atmURL.trafficmanager.net" ----> THIS SHOULD POINT TO THE ATM
],
"serverFarmId": "serverFarmId",
}

`

All 4 comments

I'm getting this same issue with my custom template as well.

Update:
I was getting the same issue as you described. This is actually by design. What you need to do is adjust your App Service template. The problem is that your hostBindings and sslBindings are being set in that template. once you remove those particular objects the traffic manager will not conflict.

@Kennethtruyers; the fix for this is to specify the ATM hostname in the hostname sections of the web app.
It fails otherwise because it assumes you are trying to remove the already existing ATM binding.

`
{
"type": "Microsoft.Web/sites",
"name": "webAppName",
"apiVersion": "2015-08-01",
"location": "webAppLocation",
"copy": {
"name": "websitescopy",
"count": "3"
},
"properties": {
"name": "[toLower(concat('webapp-', parameters('webSiteNames')[copyIndex()]))]",
"hostNames": [
"default.azurewebsites.net"
"atmURL.trafficmanager.net" ----> THIS SHOULD POINT TO THE ATM
],
"serverFarmId": "serverFarmId",
}

`

Both the solutions recommended by @stack111 back in 2016 and by @abdulapopoola in 2018 work. However, in my opinion Daniel's solution (the first one) is better because it doesn't create a circular dependency between web applications and traffic manager. In other words, with the second solution the ARM template of the web app needs to know about Traffic Manager hostname; and TM configuration needs to know the endpoints of the web apps.

Unless I am mistaken, adding TM hostname to hostNames section for the web app, requires the TM to be already provisioned.

This is strange! I wonder why this demo template is working when trying repeatedly, but in CICD when my deployment is incremental, I am getting deployment failure and it says, traffic manager already exists!

Was this page helpful?
0 / 5 - 0 ratings