To troubleshoot the issue of moving a custom domain from one Azure App Service to another, follow these steps:
- Verify Domain Removal: Ensure that the domain has been completely removed from the previous App Service. If the domain is still bound to the old service, it cannot be added to the new one. You may need to contact Azure support to release the domain if it appears locked.
- Check DNS Configuration: Make sure that the DNS records are correctly configured for the new App Service. For a root domain, you need an A record pointing to the app's IP address and a TXT record for verification. If you are using a subdomain, a CNAME record is recommended. Ensure that both records are present and correctly configured.
- Clear Caches: Clear your browser cache and DNS cache. You can flush the DNS cache on a Windows machine using the command
ipconfig /flushdns. This helps to eliminate any cached old IP addresses that may be causing the 404 error. - SSL Binding: If you are having trouble with SSL binding, ensure that you have added a certificate for the domain. If the domain does not have a certificate binding yet, you will encounter issues accessing it securely. You can add a private certificate for the domain and configure the binding accordingly.
- Check for Conflicting Records: Ensure that you do not have conflicting DNS records (like both A and CNAME records for the same domain), as this can prevent proper resolution.
- Domain Status: In the Azure portal, check that the domain appears as "Active" in the custom domains list for your new App Service. If it does not, you may need to re-add it.
Following these steps should help resolve the issues you are experiencing with moving your custom domain to a new Azure App Service.