0
votes

I have an Azure Webapp on a Standard 1 Small App Service Plan, I deployed my application successfully to the webapp, but now I need to test it using a specific domain name that on client side could be configured using hosts file.

The problem is that the Azure webapp will only "recognize" the custom/specific domain (ex: myapp.mydomain.com) if I configure a Custom Domain that uses public DNS and I can't (at this moment) configure the existing domain name to be a CNAME to the Azure webapp because it is production environment, I can and will make the CNAME after the application is tested not before.

My application requires to be called by the specific domain name.

So how can I test my application on Azure webapp using a custom domain but without using public DNS using only my hosts file client side?

note: this problem doesn't even exist in AWS Beanstalk so why is this so complicated with Azure webapp. Its pretty basic

2

2 Answers

2
votes

You can preemptively associate your custom domain name with your web app and test it via a client using the host file. To verify domain ownership, Add a TXT record. The TXT record maps from awverify.<subdomain> to <appname>.azurewebsites.net. Steps to do this are outlined here:

https://docs.microsoft.com/en-us/azure/app-service/manage-custom-dns-migrate-domain

0
votes

Using App Service, I don't think you can do this. It configures the underlying app to only listen for domains configured in the Web App. So if you don't add the domain as a custom domain, requests won't be routed to the app. The reason is that IP addresses are shared, so Azure relies on the Host header to route your request correctly.

You can add the custom domain without CNAME / A record by using the awverify record mentioned by Ken.