Root domain works but subdomain doesn't - Azure - azure

I created a static web app on Azure and connected my domain via Azure DNS zone.
I added all the necessary records and my root domain works with https.
I also added cname record for www but when I try to access to my website with subdomain (www.example.com) it doesn't show with https therefore my chrome browser doesn't allow me to view the page with subdomain.
How can I fix this?
There's a minor detail that I suspect it may affect, I also added my Microsoft 365 Business records in the Azure DNS zone. (it has txt, MX, and CNAME records). In total, I have 3 CNAME records. 1 for Microsoft 365, 2 for the static web app. (Because it's a domain from google, I had to add custom nameservers, and it was the only way to add my Microsoft 365 records in my domain.)

I am able to reproduce the issue, follow the below steps
After deploying the Azure static web app into the portal
Goto Custom domains => click on add => click on Custom domain on azure DNS as shown below
After clicking on Custom domain on azure DNS it will open a page where we have to enter Domain name example: www.example.com & DNS name we have to select from existing name Example: example.com => click on Add as shown below
After successful deploying open the link in Crome, AFAIK static web App will take by default as HTTPS

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.

How to transfert a domain to azure

I have bought a domain from OVH and I want to transfert it to my azure subscription.
I Have unlocked the domain in OVH and got my Auth/Info code.
But when I try to buy the unprotected domain on azure, it doesn't appear in the select list.
The domain is a .net domain.
So, do you know how to transfert a, unprotected .net domain from ovh to azure ?
You don't transfer as such, the process is pointing the domain at your specific service. If you are pointing your domain at an Azure App Service then you need to make some DNS changes on your domain.
For Web Apps, the process is at follows:
In your browser, open the Azure Portal.
Click the Browse option on the left side of the page.
Click the Web Apps blade.
Click the name of your web app.
In the Essentials page, click All settings.
Click Custom domains and SSL.
In the Custom domains and SSL blade, click Bring External Domains. The IP address is located at the bottom of this part.
Then you can create an A record in DNS for your domain pointing to the IP you got from the above steps and a CNAME pointing to yoursite.azurewebsites.net.
For A records, you will need to create a awverify record in DNS, details on how to do this are in the documentation.
To transfer your domain from XYZ domain register, for example https://www.hover.com/, go to Azure Portal and use the App Service Domain service, which is currently in Preview state.

Direct 1and1 domain to Azure site

In the past I have been able to just change the nameservers, wait a short while and then create an addon domain on my hosting.
However this doesnt appear to be how Azure works. I keep reading I have to create a CNAME. 1and1 only allows CNAME's on subdomains. I have done this and I have xxx.mysite.org successfully pointed at mysite.azurewebsites.net.
Without using a HTTP redirect can I get mysite.org pointing at mysite.azurewebsites.net?
Thanks!
After days trying to tackle this and reading endless articles online, I finally found the solution. I found numerous articles on mapping and configuring custom domains with azure including getting Error 404 - Website not found after configuring azure (which I also faced) but lacked the detailed configuration with 1and1 which was the main issue.
Some of the top-level articles I've been through I've listed below.
Map Custom domain to Azure App
https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-custom-domain-name
Configure custom domain to azure app
Configuring custom domain for Azure Web App
https://learn.microsoft.com/en-us/azure/cloud-services/cloud-services-custom-domain-name -- Refers to Cloud Service and/or Web App
Error 404 - Web Site not found - Azure web site
https://social.msdn.microsoft.com/Forums/azure/en-US/c7974e51-8022-47cb-9a8c-ff7643966dc3/error-404-web-site-not-found-azure-web-site?forum=windowsazurewebsitespreview
Solution
1and1 Domain Configuration
Go to 1and1 control panel > Domains > Edit DNS Settings.
In Edit DNS Settings, the Name Server Settings should remain 1 & 1 name server.
In A/AAAA and CNAME Records section, select 'Other IP Address' and enter the IP which is assigned to you azure web app, you can find this through accessing your web app and going to 'Custom Domains'.
Add a TXT record with the value being yourappname.azurewebsites.net and click save.
Create a sub domain in 1and1 portal called awverify.mydomain.extension (where extension is your domain extension .i.e .com/.net/.co.uk), click Save
After you create your sub domain, go back to the domain section and next to your domain name click on 'Manage Sub Domain (for that domain)'
Expand the Sub Domain you created and click on 'Edit DNS Settings'.
In the 'Edit DNS Settings' on the A/AAAA and CNAME Records section, select 'Other IP Address' and insert the same app IP Address in the IPv4 text box and click Save.
Go back to your Main 'Manage Domain' section in 1and1 and repeat steps 5, 6, 7 and 8 only this time, your sub domain should be www.yourdomain.yourextension and in step 8 the additional configuration is that you add a TXT record, the value of your TXT record should be yourappname.azurewebsites.net.
After you have finished with the 1and1 configuration, it is strongly advised to wait at least between 12-48 hours to allow the propagation to complete before trying to validate your app in azure, in some cases this might work after a couple of hours.
Then configure Azure to recognise your domain.
Azure Web App Configuration
Go to your app > Custom Domain > Add Hostname
In hostname text box, type yourdomain.yourextension and click validate, on successful validation click 'Add Hostname'
Repeat step 2 to add www.yourdomain.yourextension.
Hope this helps.
You don't have to use a CNAME to use a custom domain with your Azure website. You can use an A record instead.
When you go to "Manage custom domains" in the Azure portal for your site, at the bottom of the window (underneath the CNAME instructions and list of domains) is the IP address to use to configure the A record.
You can use this to configure the DNS for your bare domain, to point it to Azure.
This is how I did it.
In your 1and1 account create a subdomain for your domain awverify.yourdomain.com
Go to DNS settings of this subdomain and under the A/AAAA and CNAME Records section, there will be radiobox for the CNAME, select this option and type in awverify.yourdomain.azurewebsites.net (this could be found in the Bring External Domains window in your azure portal)
When you save your changes here, it might notify you an error, just wait for a few seconds or minutes then click save button again to save your changes.
After successfully saving the subdomain DNS settings, go to the DNS settings of your domain, now under A/AAAA and CNAME Records section, select Other IP Address and in the IPv4 Address text field, type in the IP address you will see under Bring External Domains in your Azure portal. Save your changes.
In your Azure portal, under Bring External Domains, type in your 1and1 domain, wait for to verify, you should see a green check mark at the right side of the text box.

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/

Azure Websites DNS

I have an azure website at yis3.azurewebsites.net - I have promoted this to be a "shared" site so that I can use a custom domain. I have the domain yorkshireimagescanning.co.uk that I bought from 123-reg.co.uk. I have configured this to give a CName record with dnsname of "awverify" and destination of awverify.yis3.azurewebsites.net.
I've waited over 12 hours and checked on digwebinterface.com and all looks good but when I click to "Manage custom domains" from the Azure portal , I enter a domain name of "yorkshireimagescanning.co.uk" but it won't accept it.
Please help
* Edit *
I've now waited a couple of days for domain propagation. Here's a screen grab from my domain registrar:
In the azure portal I've tried to add the following custom domains for the yis3.azurewebsites.net site but it won't accept any:
awverify.www.yorkshireimagescanning.co.uk
www.yorkshireimagescanning.co.uk yorkshireimagescanning.co.uk
awverify.yorkshireimagescanning.co.uk
Here's a screen grab from the portal:
To use yorkshireimagescanning.co.uk
To use your domain without the www. prefix you need to add an A Record in addition to the CNAME you've added for "awverify".
First, make sure you've added the domain to the Azure portal by following the instructions under "Set the domain name in management portal" here.
Next, follow the instructions under "Configure an A record for the domain name" on the same page. This involves pointing your domain directly at the IP address of the Azure web site. You should then have added 2 DNS records in total:
CNAME awverify.www awverify.yis3.azurewebsites.net
A xx.xx.xx.xx (your website's IP address)
I've marked the next option as "preferred" because it points your domain at the Azure hostname "yis3.azurewebsites.net" instead of directly at the IP address. The IP address of your Azure website won't change, but if you ever need to deploy your website elsewhere it will have a different IP, so there will be a delay while the DNS change propagates.
To use www.yorkshireimagescanning.co.uk (preferred)
To use your domain with a www. prefix you need to add another CNAME record in addition to the one you've already added.
First, make sure you've added the domain to the Azure portal by following the instructions under "Set the domain name in management portal" here.
Next, follow the instructions under "Configure the CNAME on your domain registrar" on the same page. This involves adding a CNAME that points "www" to your Azure website's hostname (yis3.azurewebsites.net). You should then have added 2 DNS records in total:
CNAME awverify.www awverify.yis3.azurewebsites.net
CNAME www yis3.azurewebsites.net
A note about domain forwarding: Don't use 301 forwarding unless your site has been permanently moved. Use 302 for temporary redirection. More details here.
I finally figured out what was wrong. I was deploying a new version of an existing site but the old version still had www.yorkshireimagescanning.co.uk set on the custom domains page. Once I deleted it then I was able to add the domain on the new azure site.

Resources