Clyde D'Souza
Clyde D'Souza

Reputation: 452

Configure Azure Traffic Manager over 2 web apps with custom domain and SSL

Background

I have two websites:
- web1.azurewebsites.net
- web2.azurewebsites.net

I have added a traffic manager called webtm.trafficmanager.net.

web1.azurewebsites.net is configured with a custom domain web.example.com. I've also added a wildcard SSL certificate to it (i.e., *.example.com). If I request web.example.com it serves the website without any issues.

Requirement

I need to setup Traffic Manager on top of these two sites. So, if web1.azurewebsites.net is down/offline, then Traffic Manager can switch to web2.azurewebsites.net automatically.

Implementation question

I've read these SO answers (SO 1, SO 2) and this docs article, however, I have some doubts. I would really appreciate if someone can confirm my understanding outlined below, please?

Step 1: I understand that I'll have to update DNS records to something like: web.example.com. 60 IN CNAME webtm.trafficmanager.net.. Remove other DNS/CNAME records that point web.example.com to web1.azurewebsites.net.

Step 2: I'll need to remove the current custom domain mapping from web1.azurewebsites.net and then re-add it. Set custom domain to web.example.com and the CNAME configuration will show the traffic manager endpoint. No DNS changes required in this step?

Step 3: Add a custom domain to web2.azurewebsites.net set the custom domain to web.example.com and the CNAME configuration will show the traffic manager endpoint. No DNS changes required in this step?

Step 4: No changes to the SSL certificate added to web1.azurewebsites.net.

Step 5: Add the SSL certificate to web2.azurewebsites.net.

Now, accessing https://web.example.com should hit the traffic manager. It will see that web1.azurewebsites.net is online, so it will direct users to that. If web1.azurewebsites.net goes down, it will auto redirect users to web2.azurewebsites.net.

Thanks!

Upvotes: 2

Views: 1023

Answers (1)

Nancy Xiong
Nancy Xiong

Reputation: 28224

Your steps are mostly correct. What you want to do is to follow this document---Configure a custom domain name in Azure App Service with Traffic Manager integration

In step 3 and step 4, the traffic manager domain name will show under CNAME configuration. Select it and click Add custom domain. No other steps are required.

If a record is already in use and you need to preemptively bind your apps to it, you can create an additional CNAME record. For example, to preemptively bind www.contoso.com to your app, create a CNAME record from awverify.www to contoso.trafficmanager.net. You can then add www.contoso.com to your app without the need to change the www CNAME record. For more information, see Migrate an active DNS name to Azure App Service.

You also could see the full steps in this blog. In this blog, it uses a second web app in a different subscription, so it selects an external endpoint for that. If your first web app and your Traffic Manager instance are in the same subscription, use an Azure Endpoint, as you would normally, and choose the web app in that subscription.

Let me know if you face any questions.

Upvotes: 2

Related Questions