Search code examples
azurednscloudflare

Cloudflare and Azure integration


I have an Azure web app service that I'm trying to use cloudflare to point to using a custom domain. I've following similar process to this https://www.petermorlion.com/setting-up-custom-domains-in-azure-with-cloudflare/

I registered the domain with Go Daddy 2 days ago and amended the name servers. Using online tools it's correctly going through cloudflare. However, it still comes up with GoDaddy default page even though the A record is pointing to the Azure web app service IP address.

I'm not sure if I've missing something or just being impatient.

Appreciate any guidance.


Solution

  • It seems that you have finished pointing your domain to the Cloudflare nameservers. Then you can map your custom domain DNS records to Azure app service.

    First of all, you need to ensure that the web app's App Service plan must be a paid tier (Shared, Basic, Standard, Premium or Consumption for Azure Functions). Then, you can use either a CNAME record or an A record to map a custom DNS name to App Service.

    Create CNAME record

    Add a CNAME record to map a subdomain to the app's default domain name (.azurewebsites.net, where is the name of your app).

    For the www.contoso.com domain example, add a CNAME record that maps the name www to <app_name>.azurewebsites.net.

    Create A record

    To map an A record to an app, App Service requires two DNS records:

    An A record to map to the app's IP address. A TXT record to map to the app's default domain name <app_name>.azurewebsites.net. App Service uses this record only at configuration time, to verify that you own the custom domain. After your custom domain is validated and configured in App Service, you can delete this TXT record.

    After you added the relative records, you can select Add custom domain of the app service settings. Verify that your domain resolves to your app's IP address using WhatsmyDNS.net. You may wait for an amount of time. If the browser has not effected on the new custom domain, you can Clear the cache and test DNS resolution again. On a Windows machine, you clear the cache with ipconfig /flushdns.

    Let me know if this works or show your records(hiding sensitive data) for further help.