Reputation: 753
Is there a way to tell Azure to add a custom domain in advance?
Currently when trying to add a custom domain to a web app it won't accept it until the domain has been updated.
Our client wants to update their DNS info at midnight which means somebody will have to log into Azure and repeatedly try adding the custom domain until Azure sees the updated domain info.
Is there a way around this?
Ideally we want to tell Azure what domain to use and update the domain.
We could tell the client we'll add it in the morning but they're playing silly buggers at the moment and won't want their site offline for even a second without calling the Spanish Inquisition. :)
Upvotes: 2
Views: 894
Reputation: 7696
The official documentation is currently a little misleading on this. You can, in fact, add the custom domain to an Azure Web App ahead of time. For this example, assume you're adding foobar.com to point to mywebapp.azurewebsites.net. Do the following:
Go to your DNS provider (NetworkSolutions, Godaddy, etc). Make a TXT record entry for Host = *, Text = mywebapp.azurewebsites.net. This will prove domain ownership to Azure. Do NOT create your A record yet unless you want to start routing traffic there.
Go to the Custom Domains blade for your mywebapp.azurewebsites.net Web App. Under Hostname, enter foobar.com. Click the Validate button. If your new TXT record has propagated, Azure will successfully verify domain ownership and allow you to add the new hostname.
At midnight when you're ready to direct traffic from foobar.com to mywebapp.azurewebsites.net, you'll need to update your DNS A record to point to your mywebapp.azurewebsites.net's IP address. Optional step: if you want www.foobar.com to point to your Web App, you'll also need to create a CNAME record when you're creating your A record. The CNAME record should have Alias = www, Host = mywebapp.azurewebsites.net.
As for setting up any SSL certs, you can do so after Azure has validated and added your custom domain from step 2.
Upvotes: 2