5
votes

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

2
I received a good answer to my similar question: stackoverflow.com/questions/47747972/…Rod
Did you get an answer? I have the exact same scenario to this. Dns is managed by client, and I just want to add an extra binding, and adjust my host file that it works.Maarten Kieft

2 Answers

1
votes

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://docs.microsoft.com/en-us/azure/app-service/manage-custom-dns-migrate-domain

-2
votes

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://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain.