- Deploying to Azure – part 1, Creating a build pipeline
- Deploying to Azure – part 2, Getting started with Azure hosting
- Deploying to Azure – part 3, Deploying the site
- Deploying to Azure – Part 4, Adding a custom domain
- Deploying to Azure – Part 5, Continuous delivery
Now I wanted to add a custom domain name. To do this we need to upgrade the account (yet again! – how free are the first 12 months?!?) First I needed to upgrade the Azure App Service Plan. This is a really good overview of what is an Azure App Service Plan and what does it do, well worth reading.
Navigate to ‘Scale up’ and select any option other than the free one. This will allow adding a custom domain.
At this stage if you use Cloudflare (like I do) to secure your app, you must bypass it now until Azure has verified the domain. I got caught out on this and had to start over with removing the domain and adding it again.
I followed this article to help me set it up: Configure a domain for an Azure App Service using Cloudflare | Software Engineering.
In the ‘Add a custom domain’ section of Azure click add and enter the domain name. If you haven’t already; you’ll need to add some DNS records to verify the domain. Adding the domain will only work once it can find those records.
I needed to add both the
https://custom-domain.co.uk domain and another with the
https://www.custom-domain.co.uk, otherwise when navigating to
www.custom-domain.co.uk it wouldn’t show up.
If all has gone well, Cloudflare can now be reenabled. By navigating to the newly added custom domain the site should show up.