Azure WebApps custom domain - CNAME pointed to azurewebsite must exist? - azure

We are trying to migrate sites from AWS to Azure WebApps.
AS IS:
The CNAME of the existing site points to Imperva. Imperva then points to AWS Site.
TO BE:
The CNAME of the existing site points to Imperva. Imperva then points to Azure WebApp Site.
PROBLEM:
When I try to add the custom domain to azure Web Apps website, it complains with the error that the existing Site MUST have CNAME pointing to Azure Website.
see example below:
This means that as part of cutover, we need to do below:
1. Quicky update CNAME to point to azure web app
2. Once custom domain is setup in azure
3. Change the CNAME back to Imperva.
This sounds bit hacky.
Is above right approach or am I missing anything here?

The part that you're missing is the direction of the CNAME. What Azure wants to do is to ensure that you do actually have authority over that domain name. So they want you to create a CNAME that points from awverify.www.example.com to www.example.com
Once that record is created Azure will looking that record and ensure that it redirects to www.example.com. This has no impact on any existing configuration (unless you just happen to have awverify sub domain in uswe already!)
www.example.com will still work in exactly the same way as before until you are ready to move that name to Azure.

Related

Migrate Website Infrastructure to Microsoft Azure

I have an accessible static HTML website set with domain and hosting. I would like to mimic this environment with Azure, meaning Azure will communicate with my domain and hosting provider.
Could I please ask to point to where should I find answer to this? It seems obvious, but I am not really sure about my search results.
You need to create CNAME record on your domain registrar account
Open a new browser tab and sign in to your domain registrar account.
Navigate to your domain name's DNS configuration settings.
Add a new CNAME record with the following values.
Setting Value
Type CNAME
Host Your subdomain, such as www
Value Paste the domain name you set aside in the text editor.
TTL (if applicable) Leave as default value.
Create a CNAME record in Azure Static Web Apps. Please find detailed step by step guide below:
https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain-external

Create a subdomain and a CNAME in Azure

I currently have an Azure domain with a website, the domain has the name aaa-aaa.azurewebsites.net
I need to create a subdomain of the style login.aaa-aaa-aaa.azurewebsites.net, which at first will point to aaa-aaa.azurewebsites.net but later I want it to point to a different domain.
I have tried to create the subdomain through the Azure console, entering App Service and then Custom Domains but I get the error:
"Domain ownership
To verify domain ownership create CNAME and TXT record with your DNS provider using the configuration below, and replace {subdomain} with value of subdomain".
I have been reviewing documentation on the internet and in the DNS zone section I have created a new zone and I have introduced the information that appears in the Custom Domains section as the guide says: https://rmiravalles.com/2020/08/05/creating-dns-records-for-a-web-app/
** What should I do to create this subdomain and its corresponding CNAME in Azure?
** Is it necessary to have a domain of the style aaa.com or could it be done with the one I currently have aaa-aaa.azurewebsites.net?
Thank you very much
[1]: Error creating subdomain: https://i.stack.imgur.com/BQ9Iz.png
[2]: DNSZone configuration: https://i.stack.imgur.com/fanN3.png
You do not own 'azurewebsites.net' (microsoft does) and therefor you can not create subdomains for that domain (others than the ones Microsoft has given to you). You should get your own domain first, than you can create dubdomains in your dns-server

Delegate Subdomain to Azure via CNAME

the company I’m working for provided me a subdomain. test.mycomp.com . I want to add it to my azure web app via custom domain.
The azure system recommends a CNAME delegation and provided me the information to enter web-zeudz-staging.azurewebsites.net in the dns management as CNAME.
After doing so and verifiying via DNS Lookup, Azure always gives me „Domain Ownership Error“. What can I do to make this work?
Is your DNS provider also a CDN provider, for example cloudflare? If so, turn off the CDN/proxy function so it's a DNS only record and try again.
If you don't have any control over the CDN function you can use txt record validation.
Create your TXT record awverify.subdomain.test.mycomp.com with value web-zeudz-staging.azurewebsites.net and validate again. It should succeed.
There's also a CNAME awverify method but you need CDN disabled for that too.
I find it strange that your company doesn't have the option to enable/disabled CDN for any given DNS entry though.

Azure Web App naked URL redirects but www does not

I have a web app deployed on Azure and I'm trying to make it so both <myurl>.com and www.<myurl>.com work. Right now I have both domains listed on Azure within my webapp. www.<myurl>.com is registered as a CNAME from www to <myurl>.azurewebsites.net in godaddy. I have an A record from # to the IP address shown by Azure, as well as a TXT record from # to the given DNS by Azure <myurl>.azurewebsites.net
The problem is when I go to http://<myurl>.com it will change the URL to <myurl>.azurewebsites.net but when I go to http://www.<myurl>.com the URL is does not change.
Below are my go daddy DNS records. Most of these were there when I bought the domain so I'm not sure what they do. There is an A record that I can't seem to edit and I don't know what that IP address belongs to either.
Alot of this can be done with an A and a CNAME. You will need to add both "www" and "awverify.www" in your DNS, and do those corresponding entries in the Azure portal.
Here's good doc:
https://blogs.msdn.microsoft.com/kaushal/2013/07/05/azure-app-service-how-to-configure-a-custom-domain/
Here's alot more details:
https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain
The Azure portal will also give clues on what to do.

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