This article - https://msdn.microsoft.com/en-gb/library/hh534477.aspx#sec7 explains the below approach on how to let customers add custom domains and map to your application.
As an alternative you could allow each tenant to create its own DNS entry that maps a domain or subdomain owned by the tenant to one of your application’s DNS names. For example, Adatum could create the following DNS entry in its DNS configuration:
surveys.adatum.com CNAME adatum.tailspinsurveys.com
Or Adatum could create the following entry:
surveys.adatum.com CNAME www.tailspinsurveys.net
In either case you could use the custom domain name in your ASP.NET routing by using the technique suggested in option 3 above, or use the Request.Url class in your code to identify the domain.
I can achieve this so far with subdomains but when I create the CNAME below to my application I end up with a 404 (Web App not found). I don't want to have to add a custom domain inside azure for each customer. I'd like to automate the process for my SaaS site.
Thanks
when I create the CNAME below to my application I end up with a 404 (Web App not found)
It seems you do not configure the custom domain correctly. I would suggest you use Dig Web interface to trace your DNS domain. Please also check your steps from this article to ensure the custom domain is configure correctly.
Related
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
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.
I have a custom domain within my app service, but can't access my web app with www prefix only without. I get error ERR_NAME_NOT_RESOLVED when trying to access with www prefix. I define my custom domain as subdomain.domain.com
Most commonly this is caused by a one of the below:
Is your App Service Plan scaled to allow Custom Domains / SSL?
Have you mapped the Custom Domain to the Domain?
For Example: have you created a CNAME or A Record on Azure DNS or your DNS Server?
Has it been added to the Custom Domains setting of the App Service?
Microsoft documentation for this is pretty good and the link for this is:
https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain
Assuming, that you already own the Domain etc etc
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.
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/