Subscribe

Azure App Service: Add a custom domain

✍️

These Azure apps are cool. In todays tutorial we will learn how to link them to a custom domain.

27 Sep, 2020 · 2 min read

We created our Node hosted Azure app and learned how to auto-deploy from GitHub.

Today we will be looking at running the web app on a custom domain.

Be aware: Custom domains are not on the free-tier, so you’ll need to have a paid account for this! 😭

Custom domain names are very important to define your project. It’s all cool if it’s a demo or testing environment, but an actual web app should run on its own domain.

How to add a custom domain to Azure App Service

First, let’s open our Azure App Service and click the Custom domains option on the left:

Azure custom domains

This will open up the custom domains menu. We will be prompted to upgrade out tier if we are on the free tier.

Once you upgrade to a small service, click add domain:

Azure web app add domain

Clicking this will open a side drawer on the right, where we can choose our custom domain. In my example, I’m using azure.daily-dev-tips.com.

Azure add domain settings

If you scroll to the bottom, you’ll see the domain ownership section. These are the settings we need for our domain host:

Azure domain ownership

The txt is optional, it seems, I only did the CNAME, and that worked well.

Adding the Azure CNAME records to your domain registrar

This section is going to be different for wherever your domain is hosted.

My domain is hosted on Netlify, so this might be different than your host.

Go to your domain settings.

Netlify Domain Settings

Your domain registrar might say something like: “DNS Management”

Now we need to add a DNS record for Azure.

DNS Record settings

My settings include this:

  • Type: CNAME
  • Name: azure (azure.daily-dev-tips.com)
  • Value: dailydevtips.azruewebsites.net (what Azure gave us)

Save these settings.

Now we need to go back to Azure to verify the domain.

Azure verify custom domain

Now, we need to do the following actions.

  1. Click validate; This will show the Domain ownership marked correct
  2. Then we need to click the Add custom domain button to complete

And we are done! Now we added our custom domain to the Azure app service. Go visit your new domain to verify it works!

Azure custom domain

I turned my custom domain off, to not pay for it 😅

Thank you for reading, and let’s connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

Spread the knowledge with fellow developers on Twitter
Tweet this tip
Powered by Webmentions - Learn more

Read next 📖

Node.js read and write from Azure Table Storage

2 Oct, 2020 · 9 min read

Node.js read and write from Azure Table Storage

Adding SSL to our Azure Node app

1 Oct, 2020 · 3 min read

Adding SSL to our Azure Node app

Join 2097 devs and subscribe to my newsletter