Custom domain and APIM

October 12, 2024

Problem Statement

Managing certificates and creating custom domains for Azure services can be a daunting task for many developers and IT professionals. Ensuring secure and reliable access to your services while maintaining control over your domain can be challenging. How can one approach creating custom domains for Azure services, and what steps are involved in verifying domain ownership and routing traffic correctly?

Solution

Azure provides a streamlined process for creating custom domains, making it easier to manage certificates and ensure secure access to your services. When configuring a custom domain for Azure API Management (APIM), for example, Azure requires you to add specific DNS records to verify domain ownership and route traffic correctly.

Steps for Configuring Custom Domain in APIM:

  1. Domain Verification:

    • TXT Record: Azure asks you to add a TXT record for apimuid.apim.srinman.com to verify that you own the domain. This step ensures that only authorized users can configure the domain.
  2. Traffic Routing:

    • CNAME Record: You need to add a CNAME record for apim.srinman.com to route traffic to the APIM service. This ensures that requests to your custom domain are correctly directed to the Azure APIM endpoint.

Azure simplifies the process by providing clear instructions and the necessary values for these DNS records. Once the records are added and verified, your custom domain will be active and securely routed to the Azure service.

Important information:

Please notice in the "Traffic Routing" section, the CNAME record is where the magic happens, as it effectively glues your custom domain to the Azure service without the custom domain. Azure simplifies the process by providing clear instructions and the necessary values for these DNS records. Once the records are added and verified, your custom domain will be active and securely routed to the Azure service.

Example DNS Configuration:

Type    Name                        Value
TXT     apimuid.apim.srinman.com    <verification-code-from-azure>
CNAME   apim.srinman.com            <your-apim-service-name>.azure-api.net

Other Azure Services Supporting Custom Domains

In addition to APIM, several other Azure services support custom domains, including:

  • Azure App Service: Host your web apps with custom domains and SSL certificates.
  • Azure Storage: Serve static content from custom domains.
  • Azure Front Door: Use custom domains for global load balancing and secure content delivery.
  • Azure CDN: Deliver content with custom domains and SSL.

References

For more detailed information, refer to the following Microsoft documentation:

By following these guidelines, you can efficiently manage certificates and create custom domains for various Azure services, ensuring secure and reliable access to your applications.


Profile picture

Written by Sridher Manivel Based out of Charlotte, NC. Linkedin