Skip to content
Will Fox
LinkedInGitHubHomepage

Adding a Custom Domain to my Azure Static Site

DevOps, Personal Site2 min read

RIP Google Domains. Don't follow these instructions anymore :)

Every site you visit on the internet is served to your computer by some web server with its own long confusing IP address. As humans, we have trouble remembering long strings of numbers like these addresses, so instead we made the web addressable through nice human-readable strings like 'google.com' and 'willfox.dev' (burying the lead here). Instead of seemingly random numbers, we can easily remember words and make mental links to concepts, companies, and people on the web.

By default, however, web servers are addressable only by their IP address. Some platforms help you go a step further. I, for example, am hosting this site as an Azure Static Web App. This service automatically gives me a unique domain name, though not exactly one I would like. To ensure uniqueness, it is a combination of random words and numbers, 'https://happy-tree-019013610.azurestaticapps.net'. What I want for my own site is a simple, direct address that is easy for anyone to remember and visit.

The only problem is that until recently I was a complete novice when it comes to custom domains. Here's how I acquired and set up my personal domain to work for this website.

Register Your Domain

First things first, you need to OWN your custom domain of choice! There are a number of sites that allow you to purchase and register domains. You may have heard of a few-GoDaddy, NameCheap, Google Domains, etc. They all seem to offer relatively similar services, but be sure to check if you think you may need a certain record type, or if you don't see the top-level domain (TLD, like '.com', '.org', etc.) that you want with one provider. In my case, I opted for Google Domains simply because of the easy search and signup experience-it was a comfortable environment for me.

Begin by searching for the domain you want to own. In my case, my last name (Fox) is very popular and also the name of a massive company, so my options are a bit limited especially with domains based on my last name. That was alright, as I wanted a personal site and was happy with anything related to my full name, Will Fox. Searching for 'willfox' yielded a whole list of results, and I was down to choosing the best TLD for the cost. (Popular TLD's like .com tend to cost more.) willfox.dev seemed to fit the bill, describe me and my site, and cost only about $10/year to own. I was sold.

Pick your favorite domain, and buy through the domain provider of your choice. Domain changes can take a bit of time to propogate (it has to reach a whole bunch of servers across the world), so you may have to break between steps at several points.

Create a New Domain in Azure

Now that you own your domain, it is time to set up your site behind it. Azure Static Apps makes it easy to add a domain right from the portal through the 'Custom domains' tab.

From that tab, start by clicking the '+ Add' button to add a new CNAME record. In the Enter domain tab, enter your domain name prefixed with www. (for me, www.willfox.dev).

Click the next button.

Verify Ownership with a Record

I was going to finish these instructions, but Google Domains has gone out of business.

Success! And a Problem...

Adding a Redirect