Azure app service wrong redirection for new domain - azure

I acquired a new domain name in Azure (let's say mynewdomain.net), assigned it to my app service, bought a certificate also in Azure and made the bindings. Apparently both the domain and certificate are properly configured.
When I invoke the domain in any browser like https://mynewdomain.net, I get redirected to https://mynewdomain.net/mynewdomain.net, and of course fails.
The problem must be very simple, but I have no clue! Can anyone point me in the right direction here?
Thanks!

To create a CNAME mapping for the www subdomain, create two records: CNAME and TXT records.
After you add the CNAME and TXT records, the DNS records page looks like the following example:
To map an A record, you need the app's external IP address. You can find this IP address on the app's Custom Domains page in the Azure portal.
After the records are added, the DNS records page looks like the following example:
For more details, you could refer to this article about mapping an existing custom DNS name to Azure App Service.

Related

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.

Custom domain and how to access site as http://

In Azure, I have purchased a Custom Domain and the configuration has been done automatically - all good till now however the site is accessible only using: www.sitename.com
If I access it using http://sitename.com only, it is not working.
For info, I tried to remove the CNAME however didnt allow.
Suppose I dont want to use the wwww, how can I do ?
Thanks.
If you want to access your website with http://sitename.com, you have to create the A record and enable the A record mapping in the app. For how to map an A record, this doc is for your reference.
1.Copy the app's IP address
2.Create the A record
An A record to map to the app's IP address.
A TXT record to map to the app's default hostname.
3.Enable the A record mapping in the app
The custom domain you configured is not secured. You'd better click on "Add binding" to bind an existing custom SSL certificate to your app. For more details, you can refer to the doc.
The in the DNS for domain sitename.com the A record to is what make http://sitename.com works.
If you want http://www.sitename.com to work you HAVE TO have a www CNAME record.

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.

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.

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

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.

Resources