3

I am trying to experiment a little bit the different configuration possibilities in Azure and I am stuck trying to correctly configure SSL custom domains when using more than one Web Site (App Service) behind a Traffic Manager.

Without problem, I was able to:

  1. Attach a custom domain ( subdomain.mydomain.com ) to an Azure App Service ( subdomain1.azurewebsites.net )
  2. Attach a custom domain ( subdomain.mydomain.com ) to an Azure App Service ( subdomain1.azurewebsites.net ) behind a Traffic Manager ( subdomain.trafficmanager.net) (addressed here)

But when I try to add a second App Service behind the Traffic Manager, I get the following issues:

1. Cannot attach my custom domain ( subdomain.mydomain.com ) to the second App Service ( subdomain2.azurewebsites.net ). Error message is:

Failed to update hostname bindings:
The host name subdomain.mydomain.com is already assigned to another Azure website: subdomain1.

I don't understand how SSL will work with the second website if I can't add subdomain.mydomain.com in the list of domains it listens to (and in fact, it doesn't if you don't add it).

2. Cannot add the second App Service to the Traffic Manager's list of endpoints. Error message is:

Failed to save configuration changes to Traffic Manager profile 'mytrafficmanager'.
Error: Some of the provided Azure Website endpoints are not valid: One or more conflicts detected in traffic manager configuration. Multiple domains point to region "West Europe": subdomain1.azurewebsites.net, subdomain2.azurewebsites.net

But when I read the documentation it does seem possible to add more than one endpoint in the same region:

If your profile contains multiple endpoints in the same Azure region, then traffic directed to that region is distributed evenly across the available endpoints (based on the configured endpoint enabled/disabled status and the ongoing endpoint monitoring). If you prefer a different traffic distribution within a region, this can be achieved using nested Traffic Manager profiles.

The example using Traffic Manager and App Service on MSDN's documentation only shows how to do it with one App Service.

Am I doing anything wrong? If yes, what is the right way to add several websites/App Services behind a traffic manager in Azure?

2 Answers 2

9

Traffic Manager does support multiple endpoints in the same region. The challenge is that the App Service has restrictions on multiple Apps in the same region sharing the same custom domain. This impacts on Traffic Manager, since the Traffic Manager profile DNS name is automatically added as a custom domain in your apps when adding them to Traffic Manager.

We are in the process of publishing new documentation that covers this exact scenario. Pasting the new text below:

Can I use Traffic Manager with more than one web apps in the same region?

Typically, Traffic Manager is used to direct traffic to applications deployed in different regions. However, it can also be used where an application has more than one deployment in the same region.

In the case of Web Apps, the Traffic Manager ‘Azure Endpoints’ type does not permit more than one Web App endpoint from the same Azure region to be added to Traffic Manager. The following steps provide a workaround to this constraint:

  1. Check that your Web Apps within the same region are in different web app 'scale units', i.e. different instances of the Web App service. To do this, check the DNS path for the <...>.azurewebsites.net DNS entry, the scale unit will look something like ‘waws-prod-xyz-123.vip.azurewebsites.net’. A given domain name must map to a single site in a given scale unit, and for this reason two Web Apps in the same scale unit cannot share a Traffic Manager profile.
  2. Assuming each Web App is in a different scale unit, add your vanity domain name as a custom hostname to each Web App. This requires all Web Apps to belong to the same subscription.
  3. Add one (and only one) Web App endpoint as you normally would to your Traffic Manager profile, as an Azure Endpoint.
  4. Add each additional Web App endpoint to your Traffic Manager profile as an External Endpoint. This requires you to use the ARM experience for Traffic Manager, not ASM.
  5. Create a DNS CNAME record from your vanity domain (as used in step 2 above) to your Traffic Manager profile DNS name (<…>.trafficmanager.net).
  6. Access your site via the vanity domain name, not the Traffic Manager profile DNS name.

Regards,

Jonathan Tuliani, Program Manager, Azure Traffic Manager

3
  • Thanks for a very complete answer. I just realized my Web App are hosted in the same cluster (scale unit), which might explain why it fails adding the same vanity URL (as described in your point 2.). Is there a way to control in which scale unit a WebApp is created, other than create/delete until it succeeds? Commented Jun 10, 2016 at 13:05
  • I'm not sure, but if there is I think it can only be done via a Support ticket. Commented Jun 11, 2016 at 22:05
  • @JonathanTuliani-MSFT how do we add the domain to webapp (which effectively asks us to add a CNAME to be pointing to xyz.azurewebsites.net) and still point the CNAME to the Manager profile DNS (<…>.trafficmanager.net)? Commented Jun 26, 2018 at 13:41
2

Jonathan,

This issue is still confusing when integrating SSL.. I'm not trying to add instances to the same region, but diff regions.

https://azure.microsoft.com/en-us/documentation/articles/traffic-manager-how-traffic-manager-works/#traffic-manager-example

This article does a good job of explaining the routing, but minus the SSL..

From the image. Say this is my configuration.. I have a *.contoso.com wildcard SSL. Of the 3 endpoints, contoso-us, contoso-eu, contoso-asia - which one do I install the SSL? Preferably all 3, but I can't set the all to use the custom domain and the SSL..

What am I missing here?

6
  • This should probably be a new question or a comment on Jonathan's answer. Especially because Jonathan won't be notified of your answer I think. Commented Sep 17, 2016 at 8:58
  • Well, I did figure this out.. Azure does let you add the Custom Domain name to each of the webapps, then you can add the SSL to each of them. Commented Sep 18, 2016 at 18:14
  • @GavinStevens - I'm having the same issue. How did you add the same custom domain, to multiple sites, across multiple regions?
    – Dave Bish
    Commented Nov 2, 2016 at 14:57
  • @GavinStevens - I've asked a question here - would be great if you could answer it - stackoverflow.com/questions/40381922/…
    – Dave Bish
    Commented Nov 2, 2016 at 14:58
  • Sorry, I don't see these notifications very often as it doesn't email me. First you create multiple sites, then on each site add the Custom Domain to hostnames. Then the SSL, you would think it would have a problem with adding it, but it lets you. Commented Jan 4, 2017 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.