How to switch domain used by existing website to new website with zero downtime - dns

This MS docs page describes purports to describe how to migrate a domain name that is currently being used on an active site, to a different site hosted on Azure App Service with no downtime, but it seems to me that key information is missing.
It describes how to add a domain verification id TXT record to the domain which then enables you to assign it to the App Service site as a custom domain. But in order for the transfer of the domain from the old site to the new site to occur with no downtime when you update the A record IP address you still need to secure the new custom domain binding on the App Service, otherwise no browser will load it anyway.
But in the Azure Portal when you go to TLS/SSL Settings -> Private Key Certificates -> Create App Service Managed Certifcate and attempt to create a certificate for the unsecured new binding, the dialog displays the following error:
Hostname not eligible for App Service Managed Certificates creation.
Ensure that your domain your-old-website.com has an active CNAME record
which is set to your-app-name-here.azurewebsites.net.
So how do I add a CNAME record to an an existing domain currently serving a different active website in such a way that satisfies Azure's prerequisities to create a managed certificate, but without breaking DNS resolution for either old site or the new site?

Related

Azure web service root domain works but not www subdomain

I have an Azure web app to which I have mapped a custom domain from another registrar. The root domain works fine and is secured with a (free) Azure SSL cert. I have not been able to get the www. subdomain to work. (It is also secured with an Azure SSL cert.)
I have followed these three articles that detail the method to Map an existing custom DNS name to Azure App Service, Add a TLS/SSL certificate in Azure App Service, and Secure a custom DNS name with a TLS/SSL binding in Azure App Service.
When I browse to the example web app, astroguru.com, it displays a simple blazor server starter page as it should. If I browse to www.astroguru.com, I get a page not found with info icon in the address bar that says the site is not secure, as shown below:
Below are the DNS records that I have created exactly as described in the first article ref'd above, which include (and see image below):
an A record pointing to the IP address of the web service.
a TXT record containing the verification ID
a CNAME record for the www subdomain that the tutorials say must
point to the original site name (e.g. astroguru.azurewebsites.net)
along with another TXT record with the hostname asuid.www and the
same verification ID.
The image below shows the two secured URLs from the Azure portal.
The image below shows the two private key certs in the Azure portal that secure the two URLs above:
Can someone tell me what I've done wrong here?
Had to recreate the certificate and rebind.

Adding a custom domain name (NOT a subdomain) to a static site hosted on Azure Storage

I have a domain registered through GoDaddy.
Currently there is an A record where:
Host: #
Points To: IP Address
This is pointing to a server that is currently serving the site.
I also have the site in an Azure Storage static web blob, and the endpoint is serving up the site and all is good.
I have tried registering a custom domain via the "asverify" method (see below), and Azure reports that it works. My custom domain "example.com" is accepted and all appears good except, navigating to https://example.com never works (after disabling the A record above).
Create a CNAME record with your DNS provider that points from the "asverify" subdomain (like asverify.www.contoso.com) to asverify.staticweb.blob.core.windows.net or asverify.staticweb.z5.web.core.windows.net. After this step completes, enter your domain below (exclude the 'asverify' subdomain). This method does not incur any downtime. To use this method, select the 'Use indirect CNAME validation' checkbox.
I have done something similar previously with AppServices. I have another domain that I have added to an AppService that is not a subdomain (so it is https://anotherexample.com NOT https://www.anotherexample.com). That was done with adding a TXT record to the DNS at GoDaddy, and works perfectly.
Does Azure Storage allow you to do this with a non-subdomain? That is the only way that I want to access the site.
Does Azure Storage allow you to do this with a non-subdomain?
Unfortunately, Azure Storage does not allow you to use non-subdomains to perform this operation. The subdomain is required, root domains are not supported.
please see:here.
While Azure Storage doesn't allow it as stated by the other anwser. You could very easily place an Azure CDN infront of it that does. To do this from the portal just go to the storage resource and search for the Azure CDN blade. From there you can create an endpoint to the storage or its static website. After creating the endpoint you can go to the resource and use the Custom Domain blade to set it up using a CNAME record.

Add custom domain to Azure web app without validation

I am on a project that is re-platforming a site from a web server to an Azure PaaS web app, in addition the site will have all new content and in some cases new URLs. We have some redirects in place to handle the mapping of old URL's to new ones. I would like to test that these redirects work correctly on my new azure web app. Normally I would update my hosts file to point at the new server, add an IIS binding so the correct website picks it up and go from there. However I don't seem to be able to bind a new hostname ("custom domain") without verifying that I own the new host name. It will just be my internal DNS that I will be altering to re-route my requests. Does anyone know how to add a custom domain in the azure web apps without validating? This doesn't sound like a big ask to me.
Thanks
Will
You can't do it without any verification, but you can do it without pointing traffic away from your existing site to your new site.
To verify you own the domain without redirecting traffic to it yet, create a DNS record called a TXT record with your domain registrar.
the "TXT host" should be
awverify.mysubdomain.mydomain.com
or
awverify.mydomain.com
The "value" should be
myapp.azurewebsites.net
just replace "mysubdomain" and "mydomain" and "myapp" with your specific info.
After you do this, the verification should succeed and you can add the custom hostname.
Here is more info about this: https://learn.microsoft.com/en-us/azure/app-service/manage-custom-dns-migrate-domain
You can use either a CNAME record or an A record to map a custom DNS name to App Service.
We recommend that you use a CNAME for all custom DNS names except a root domain.
If you missed a step or made a typo somewhere earlier, you see a verification error at the bottom of the page.
If you will use A record, you can create a TXT record to map to the app's default hostname .azurewebsites.net. App Service uses this record only at configuration time, to verify that you own the custom domain. After your custom domain is validated and configured in App Service, you can delete this TXT record.
Reference: https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain.

Manage domain name purchased through azure

I purchased a custom domain name through Azure, and it was correctly pointing to my Web App, and it was working. I subsequently deleted and recreated the Web app, and the underlying IP has changed. In order to associate the same domain name with the replacement app, Azure requires the CNAME to be set by the DNS provider. However, Azure is the DNS provider, and I can find no way to do this. I see lots of articles discussing how to manage the domain name once it is associated with the app, but not how do to manage it the gap between creation and association, which is the gap where I need to add the CNAME.
Take a look at this: http://blogs.msdn.com/b/waws/archive/2014/10/01/mapping-a-sub-domain-to-an-azure-web-site.aspx
and this: https://azure.microsoft.com/en-us/documentation/articles/cloud-services-custom-domain-name/
Edit: Also, you could do what you are asking for through Powershell: https://azure.microsoft.com/en-us/documentation/articles/dns-web-sites-custom-domain/
The problem occurs because the subscription was changed from a pay-as-you-go subscription to developer benefits subscription. The purchase of the domain name is tied to the subscription with it was purchased. Creating the App under the original subscription enables the management blade.
Did this recently, using "myfunkydomain.com" and "myfunkywebapp" as examples ..
Bought the domain through Azure ("Custom domain and SSL" blade on the WebApp) which you have already done.
The new "DNS preview" service allows you to create DNS Zones and then manage the subdomain recordsets - Create a new zone (I called "myfunkydomain.com" and take note of the 4 DNS servers allocated to the zone.
Then under "Custom domain and SSL" blade of your Web App select the new domain (myfunkydomain.com) under "Managed Domains" and then click the Advanced menu button - this will take you to a seperate site where you can delegate the domain to the 4 DNS servers from step 2. This is what you are missing I think. I took note of the current DNS servers before changing them (but have had no need to change them back)
Once delegated you can create CNAME recordsets under the DNS preview Zone and point the CNAME record to the full domain of your Web App myfunkywebapp.azurewebsites.net and you are in full control of the domain from the Azure portal. There is a WebApi for managing this whole process which we use to create new tenants of our domain programatically.

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