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

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!

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.

Related

Unable to access CDN endpoint via custom subdomain

my team and I are currently exploring using Azure static site blobs and CDN endpoints to host several web apps.
We have successfully deployed our static files to the blog storage and our entire test app loads on both the primary (name.abc.web.core.windows.net) and CDN (name.azureedge.net) endpoints. When it comes to mapping a custom subdomain via the “cdnverify” temporary step, however, I am unsuccessful.
I have very carefully followed and quintuple-checked all steps in the support doc "Tutorial: Add a custom domain to your Azure CDN endpoint" (here).
This is my current DNS config (via Namecheap).
When I skip the cdnverify step, e.g. assign the azureedge CNAME value directly to a host called “v2”, and add that as a custom domain in my Azure portal CDN blade, the subdomain begins loading the CDN endpoint and can even have a CDN-managed HTTPS cert deployed with no manual verification. A dig command to this host (v2.ourdomain.org) finds an expected response (view here).
Here's the rub, though. If I assign a CNAME host of “cdnverify.static” to “cdnverify.name.azureedge.net.” and add it as a custom domain in the portal’s CDN blade, however, this secondary subdomain never loads our endpoint, and cannot deploy an HTTPS cert. The Azure portal verified this host when added to the endpoint and a dig command to “cdnverify.static.ourdomain.org” shows this answer, which looks good.
A dig command to “static.ourdomain.org” returns no answer and a ping command says “unknown host”. This is expected since I’ve not created such a record yet, and so I am wondering how we’re meant to ensure this subdomain is verified as per the “Verify the custom domain” section in the above-mentioned doc.
It’s very important for us that the cdnverify host works and can be assigned a certificate before we permanently re-locate our domains as these apps are already in production. At this point, I am at a loss over what to try next. If possible, I’d love to know what step(s) I am missing, or what can further be done to diagnose the issue.
Many thanks to anybody who might have some advice!
The cdnverify subdomain is to create a temporary CNAME mapping to avoid interruption of web traffic. With this method, users can access your domain without interruption while the DNS mapping occurs. If you have not any existing web app work, you can skip the cdnverify step.
From your description, "a dig command to cdnverify.static.ourdomain.org shows this answer, which looks good." It indicates that the cdnverify host works and you have verified that. You just need to associate the custom domain with your CDN endpoint.
In this step, you enter your custom domain like static.ourdomain.org, including the subdomain. Do not use the cdnverify subdomain name.
After you have added the custom domain static.ourdomain.org successfully in the CDN endpoint.
At this point, your custom domain has been verified by Azure, but
traffic to your domain is not yet being routed to your CDN endpoint.
After waiting long enough to allow the custom domain settings to
propagate to the CDN edge nodes (90 minutes for Azure CDN from
Verizon, 1-2 minutes for Azure CDN from Akamai), return to your DNS
registrar's web site and create another CNAME record that maps your
subdomain to your CDN endpoint. For example, specify the subdomain as
www or cdn, and the hostname as .azureedge.net. With
this step, the registration of your custom domain is complete.
After you have completed the registration of your custom domain, verify that custom domain references your CDN endpoint.
Finally, you could freely remove the cdnverify CNAME record in your domain provider as it was necessary only as an intermediary step..
Ref: https://github.com/uglide/azure-content/blob/master/articles/cdn/cdn-map-content-to-custom-domain.md#how-to-map-custom-domain-to-content-delivery-network-cdn-endpoint

Unable to use Custom domain purchased thru Azure with App Service

I recently purchased a new custom domain to use with my App Service. I have done this before without any problems but cannot get this setup. I have tried to set this up via two methods:
1) Add hostname binding within the Custom Domain blade. This fails with an error with no extra details.
Add hostname bindings
2) Add custom domain within the App Service blade
Configure custom domains
This fails on domain ownership and ask me to create a CNAME configuration record.
Add CNAME error
I assume this is also why option 1) fails silently.
 
I have tried this by entering the Advanced Management Portal on the Custom Domain blade but this does not give me access to add any DNS records, all I can do it edit the Nameservers.
Help !!!!  This means I am left with a domain I purchased that I cannot use and I cannot no longer buy this through an external provider so I can setup it up externally from Azure.
You need to update the custom domain so Azure manages the DNS. It can then add the appropriate DNS records when you add bindings.

How to perform third party Domain setup on Microsoft Azure?

I have set up AD Azure and since I have a domain from a third party hosting provider(re-seller) i needed to assign MX and TX values in order to verify the Domain.
Re-seller refused to manually setup the records in the domain registrar and provided a free shared hosting package for me to setup those values in the control panel which i did with no effort and successfully verified the domain name within Azure portal.
I had made all the wire up within azure portal to use the domain i had verified but when i browse y.com i get responses from the Re-seller server instead of Azure.
The only thing i had left to do is to change the NS records which the Re-Seller refused to do so - so far.
Please provide some details of how the request travels in this kind of Domain name setup and what measures should i take in order to use my domain in Azure hosted environment?
To bind a custom domain for your Azure app, you need to do three main steps to map the custom domain to your app( more detail refer here):
And if you also want to add a custom domain for Azure AD, you can refer this document.

Azure Websites - Masking Azure domain name

In the next several months we will be going live with a web app ('MyApp') that is being hosted on Azure. We have purchased the MyApp.com domain and our Azure domain name is MyApp.azurewebsites.net.
We do not want our users to ever see the azure domain name in any form. We want them to see www.MyApp.com or www.MyApp.com/Sales/ViewSale etc.
I think I know how to map www.MyApp.com to MyApp.azurewebsites.net based on this article. We won't be able to set this up for a while, so I'd like to know what the user will see in their browser URL when they go to www.MyApp.com. Will they see www.MyApp.com or MyApp.azurewebsites.net? And then what will they see as they navigate various pages in the app?
Your azure website needs to be at least at the 'shared' level. This is the first tier of 'paid' azure website hosting. You do this under website > scale.
app service plan pricing tier = shared.
then you would choose 'configure' and look for 'domains' and add your www.myapp.com domain.
Then you head out to your DNS manager and add a CNAME record that directs traffic from www.myapp.com to myapp.azurewebsites.com, OR you can lookup up the Virtual (public) IP of your azure website and update the A record in your DNS manager.
Either route, your visitors will see www.myapp.com/mypage, www.myapp.com/mypage2, etc.
Once you have the proper hosting level (the control panel will tell you, look for custom domains) and configuration, they can access it as www.myapp.com. You may need to provide your own SSL cert in order to configure it as well.
When it comes time to SSL, check out this post (Azure SSL Certificate) that I made regarding uploading of SSL certs in the control panel. It will save you a headache.
The article you linked appears to have solid information based upon my recent experiences. One thing to note: It has screen shots from the old configuration panel, so some things may look different in the new one.
I haven't found a way to hide the myapp.azurewebsites.com method to access a page, other than maybe doing a redirect inside your code. However, until you have your DNS setup it might be nice to see things working under that domain to start.

Configuring Google Domain to point to Azure website

I have an site hosted on Azure that I am trying to point a domain from Google Domains to.
My current configuration is as follows:
Name Type Data
# A XXX.XXX.XXX.XXX
www CNAME history-podcasts.azurewebsites.net
awverify CNAME awverify.history-podcasts.com
I am following the instructions from here: Configuring a custom domain name for an Azure Website.
When I go to the Azure portal to Manage Domain and attempt to enter the url in DOMAIN NAMES, I get the following message:
A CNAME record pointing from history-podcasts.com to history-podcasts.azurewebsites.net was not found. Alternative record awverify.history-podcasts.com to awverify.history-podcasts.azurewebsites.net was not found either
When I go to the URL for the domain, I get the following message:
The website you have attempted to reach is not available in this Microsoft Azure Web Sites region. This could be due to one of several reasons:
The web site owner has registered a custom domain to point to the Microsoft Azure Web Site, but has not yet configured Azure to recognize it. Click here to read more.
When a site owner wants to use a custom domain with a Microsoft Azure Web Sites website, Azure needs to be configured to recognize the custom domain name, so that it can route the request to the appropriate server in the region. After registering the domain with a domain provider and configuring a DNS CNAME record to point to the site's Azurewebsites.net address (for example, contoso.azurewebsites.net), the website owner also needs to go to the Azure Portal and configure the site for the new domain. Click here to learn more about configuring the custom domains for a web site.
This is the same configuration settings I am currently using for several domains through Namecheap with Azure hosting and they work as intended.
EDIT:
To summarize, here are the steps you need to take:
1) Create CNAME record redirecting user from your domain to Azure specified domain using tools provided by your DNS hosting service
This step will ensure that when going to www.history-podcasts.com user will transparently be taken to history-podcasts.azurewebsites.net
Type: CNAME
Name: www
Value: history-podcasts.azurewebsites.net
IMPORTANT: Please note that it takes time for DNS servers to update their records therefore you should wait around 30 minutes before continuing.
2) Redirect your naked domain to subdomain using DNS hosting service tools
This step will ensure that when going to history-podcasts.com user will be redirected to www.history-podcasts.com
For Google Domains you can follow this guide here.
3) Add your domain to Azure Website
This step will assure Azure that you own the domain and you want your site to be reachable using specified domain name.
Login into https://manage.windowsazure.com/
Navigate Websites -> [Your Website] -> Configure
Scroll down to Domain names
Click Manage Domains (note that custom domains can only be used when in the Shared, Basic, or Standard modes)
Add your domain www.history-podcasts.com
At this point you should be able to reach your web site using both history-podcasts.com and www.history-podcasts.com domain names.
If your website requires HTTPS, you will have to take extra steps:
http://azure.microsoft.com/en-us/documentation/articles/web-sites-configure-ssl-certificate/

Resources