Tips and tricks to perform custom domain operations in Azure Front Door Premium
Published May 26 2022 08:00 AM 4,695 Views
Microsoft

Here I will go through the steps to create a custom domain and host it on Azure Front Door premium and go through the custom domain validation process. Also, this walks through the common scenarios around custom domain removal/deletion and steps to overcome the common errors.

 

In this scenario, I have already deployed an Azure Front Door Premium and added the origin, the app service, and also updated the route configurations to the Azure Front Door Premium resource. We will have a walk-through of the steps to add the custom domain to the Azure Front Door premium and the various stages of custom domain validation. Here I am using a custom domain delegated and hosted on Azure, Azure managed DNS. For hosting a custom domain (an APEX custom domain) on Azure DNS, please check this out Host custom domain on Azure DNS.

 

Note: If you are using a custom domain purchased from a third-party DNS Provider and plan for managing DNS records in the DNS Provider instead of using Azure DNS for hosting it, the DNS records are managed in the Domain provider.  For more information: Please check Manage custom domain on Domain Provider. 

 

Steps to add a custom domain on Azure Front Door premium:

 

1. Navigate to the "Domains" Page of the Azure Front Door premium resource on Azure Portal, under the "Settings". Click on "Add a domain", choose the DNS zone that is previously created for the custom domain and the custom domain and click "Add" to save it. If the DNS zone is not created yet, follow these steps to do it. Create a DNS Zone 

Aarthi795_MSFT_0-1654021293210.png

 

2. Upon clicking on "Add", we will see that the custom domain is being created. Let us wait for this to complete.

Aarthi795_MSFT_1-1654021793611.png

 

 

We will see that the validation state now shows "pending" as the custom domain is added or created to the Azure Front Door premium profile and the Azure Front Door premium endpoint is unassociated.

 

Aarthi795_MSFT_1-1653524542812.png

 

Now we see that the Azure Front Door Premium profile is yet to be associated so we will proceed with that step, clicking on "Unassociated" that prompts to the page where we can associate the custom domain to the Azure Front Door Premium profile. Once the endpoint and route are selected from the dropdown, click "Associate" to complete this step. 

 

Aarthi795_MSFT_2-1653524784368.png

3. Now we see that the association of the Azure Front Door Premium endpoint is complete for the custom domain and we will update the TXT record for pending domain validation, click on "Pending" under validation state as we will be prompted to update the TXT record. 

Aarthi795_MSFT_5-1653525229523.png

 

 

Click "Update" to update the TXT record. Once the TXT record update is complete, we will see a green tick mark for that step as shown in the below screenshot.

Aarthi795_MSFT_6-1653525365671.png

It takes a few seconds to update the TXT record validation under the "Validation state" for the custom domain and as we refresh, we can see that it changes to "Approved" with certificate (managed certificate as it is being used in this example in this blog), and we can further update the CNAME record to complete this custom domain validation step.

Aarthi795_MSFT_7-1653525652981.png

 

Click on the DNS state to update the CNAME record.

Aarthi795_MSFT_8-1653525722279.png

Click "Add" to add the CNAME record and update it to the custom domain.

Aarthi795_MSFT_9-1653525784764.png

You will see the CNAME record creation and adding it completes and we see the DNS state complete.

Aarthi795_MSFT_10-1653525855282.png

We can now see the custom domain validation is complete quickly with Azure Front Door premium, as seen under the Properties in the Overview page of the Azure Front Door Premium profile.

Aarthi795_MSFT_11-1653525935834.png

 

Now we see the custom domain validation is complete! We can test it by launching the endpoint hostname in the browser and in another browser window we can test the custom domain by launching it.

 

 

Test the Azure Frontdoor Premium endpoint hostname:

 

 

Test the Azure Frontdoor Premium custom domain:Aarthi795_MSFT_1-1653527577378.png

Aarthi795_MSFT_0-1653527491054.png

 

 

 

Steps to remove the custom domain from the Azure Front Door Premium profile:

 

We will walk through the steps to delete the custom domain after previously discussing the steps to successfully add a custom domain to the Azure Front Door Premium. For adding a custom domain, we added the custom domain and then associated it with the Azure Front Door Premium endpoint and updated the route. Now we have to dissociate the route and Front Door endpoint from the custom domain to be successfully able to delete the custom domain. 

 

A common error when trying to delete the custom domain when the route and Front Door profile is associated with the custom domain:

 

An error like this mentioned in the below screenshot appears when we try deleting the custom domain that has the route and Front Door endpoint associated with it.

Aarthi795_MSFT_2-1654022356886.png

 

 

To resolve this error, we have to follow the below steps:

 

1. Dissociate the Front Door Premium endpoint and the route from the custom domain, this can be done by just removing the association of the Front Door Premium endpoint to the custom domain by navigating to the route and updating it. Navigate to the Front Door Manager and click on the route. 

Aarthi795_MSFT_1-1653536165759.png

 

Now uncheck the custom domain checkbox under the domains, when updating the route and click "Update" to update the route with the dissociation of the custom domain.

 

Aarthi795_MSFT_2-1653536261783.png

 

 

Updating the route saves the Front Door Premium endpoint with this configuration and we can verify if it is seen dissociated under the custom domain by navigating to the "Domains" page.

Aarthi795_MSFT_0-1654025401303.png

 

 

Now, go ahead and try to click "Delete domain" to remove the custom domain from the Azure Front Door premium endpoint.

 

Aarthi795_MSFT_0-1654022710953.png

 

 

 

Now without any error, we should be able to successfully delete the domain, ensuring the Front Door endpoint is already dissociated from the custom domain.

 

Aarthi795_MSFT_5-1653536571499.png

 

This takes a few seconds to delete or remove the custom domain and we can see it is complete within a few seconds.

Aarthi795_MSFT_6-1653536641965.png

 

 

I hope this post was useful and helped with a better and simplified view for understanding custom domain operations on the Azure Front Door Premium profile.

 

Happy Learning!

 

FastTrack for Azure:  Move to Azure efficiently with customized guidance from Azure engineering. FastTrack for Azure – Benefits, and FAQ | Microsoft Azure 

 

 

 

 

 

1 Comment
Co-Authors
Version history
Last update:
‎Jun 01 2022 07:34 AM
Updated by: