How to add a "custom domain" to Azure CDN (Microsoft CDN classic) without any downtime

Mattia 36 Reputation points
2022-05-27T09:42:16.457+00:00

Hi,

I'm looking to add a CDN behind a website www.foobar.com, which DNS is not hosted at Azure. I've already set up the CDN, and I have a wwwcdn.foobar.com (and of course the related www-foobar-com.azureedge.net) that already works just fine.

Now, the process to add the www.foobar.com "custom domain" to the CDN configurazion involves first switching the CNAME to it, then clicking on the azure portal, then wait for deployment, etc. That takes at least a few minutes of downtime of the website (and assumes everything will work great).

Is there a way to configure the CDN to accept connection from a new domain (www.foobar.com in this case) without switching the CNAME of it first?

Azure Content Delivery Network
0 comments No comments
{count} vote

Accepted answer
  1. GitaraniSharma-MSFT 49,261 Reputation points Microsoft Employee
    2022-05-27T13:09:45.593+00:00

    Hello @MattiaRizzolo-4346 ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand that you would like to add a custom domain "www.foobar.com" (whose DNS is not hosted at Azure) to Azure CDN without any downtime and want to know if there is way to achieve this.

    Yes, you can achieve this by mapping your custom domain to your CDN endpoint hostname with the Azure cdnverify subdomain. This process creates a temporary CNAME mapping. cdnverify subdomain in Azure is used to provide an intermediate registration step so that users will be able to access your domain while the DNS mapping takes place and you want to avoid interruption of web traffic.

    Register a custom domain for an Azure CDN endpoint using the intermediary cdnverify subdomain to avoid downtime:

    • Log into the Azure Portal.
    • Go to the CDN Profile blade, click the CDN endpoint with which you want to map to a custom domain.
    • At the top of the endpoint blade, click the Add Custom Domain button. In the Add a custom domain blade, you'll see the endpoint host name, derived from your CDN endpoint, to use in
      creating a new CNAME record. The format of the host name address will appear as <EndpointName>.azureedge.net. You can copy this host name to use in creating the CNAME record.
    • Navigate to your domain registrar's web site, and locate the section for creating DNS records.
    • Create a new CNAME record with the cdnverify subdomain as below:
      Source: Enter your custom domain name, including the cdnverify subdomain, in the following format: cdnverify.<custom-domain-name> (For example: cdnverify.www.foobar.com)
      Type: Enter or select CNAME.
      Destination: Enter your CDN endpoint hostname, including the cdnverify subdomain, in the following format: cdnverify.<endpoint-name>.azureedge.net. (For example:
      cdnverify.foobar.azureedge.net)
    • Return to the Add a custom domain blade, and enter your custom domain, including the subdomain, in the dialog box. For example, enter the domain name in the format www.foobar.com.
      Note that in this step, you do not need to preface the subdomain with cdnverify.
    • Azure will verify that the CNAME record exists for the cdnverify domain name you have entered. If the CNAME is correct, your custom domain will be validated.
    • At this point, your custom domain has been verified by Azure, but traffic to your domain is not yet being routed to your CDN endpoint. After waiting long enough to allow the custom
      domain settings to propagate to the CDN edge nodes (90 minutes for Azure CDN from Verizon, 1-2 minutes for Azure CDN from Akamai), return to your DNS registrar's web site and create
      another CNAME record that maps your custom domain to your CDN endpoint.
      Source: Enter your custom domain name. (For example: www.foobar.com)
      Type: Enter or select CNAME.
      Destination: Enter your CDN endpoint hostname in the following format: <endpoint-name>.azureedge.net. (For example: foobar.azureedge.net)
    • Finally, you can delete the CNAME record you created using cdnverify, as it was necessary only as an intermediary step.
    • Verify that the custom subdomain references your CDN endpoint:
      After you have completed the registration of your custom domain, you can access content that is cached at your CDN endpoint using the custom domain. First, ensure that you have public
      content that is cached at the endpoint. For example, if your CDN endpoint is associated with a storage account, the CDN caches content in public blob containers. To test the custom domain,
      ensure that your container is set to allow public access and that it contains at least one blob.
      In your browser, navigate to the address of the blob using the custom domain. For example, if your custom domain is cdn.foobar.com, the URL to a cached blob will be similar to the
      following URL: http://cdn.foobar.com/mypubliccontainer/acachedblob.jpg

    Refer : https://video2.skills-academy.com/en-us/azure/cdn/cdn-map-content-to-custom-domain?tabs=dns-provider%2Cazure-portal%2Cazure-portal-cleanup#map-the-temporary-cdnverify-subdomain

    https://github.com/uglide/azure-content/blob/master/articles/cdn/cdn-map-content-to-custom-domain.md#register-a-custom-domain-for-an-azure-cdn-endpoint-using-the-intermediary-cdnverify-subdomain

    Kindly let us know if the above helps or you need further assistance on this issue.

    ----------------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Mark Phillips 0 Reputation points
    2023-02-18T09:30:18.08+00:00

    What about how to handle the SSL Certificates? How should you do that to ensure the website remains active until the final cutover?