An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Hi Alex,
Thanks for reaching out to Microsoft Q&A.
AFAIK API Management only does the DNS/DCV (CNAME) check at the moment you first add a hostnameConfiguration. Once APIM has validated “api.mycompa*.com* <your-apim>.azure-api.net” and issued your cert, subsequent ARM/Bicep PUTs of that exact same hostnameConfiguration won’t re-trigger the CNAME check. You can ly sw your public DNS record to an A-record against your App Gateway between deployments without breaking APIM’s existing custom-domain binding.
Below are the few best practices:
- Azure-managed (free) certificate
- Initial issuance will require your CNAME (and TXT for DCV) in DNS.
- Auto-renewal for the Azure-managed cert does rely on DCV, so if you remove the CNAME/TXT you risk a renewal failure down the road.
- Bring-Your-Own or Key Vault certificates
- You still need the CNAME/TXT on the first bind, but after that APIM never re-checks DNS or re-fetches a cert from the CNAME.
- Auto-renewal is handled by Key Vault (no extra DNS record needed), so you can flip your public DNS to A-record and never worry about DCV again.
- Bicep idempotency
- Your
hostnameConfigurationsblock in Bicep only describes the APIM resource (hostname, cert, Key Vault reference, etc.). DNS is external and orthogonal. - On each “az deployment group create” Bicep will PUT the same hostnameConfiguration and it won’t force a re-validation.
Recommended approach for production behind App Gateway:
- Use a Key Vault–backed cert for your custom domain.
- In DNS keep an A-record for
api.mycompany.com → AppGw public-IP. - In Bicep define your
hostnameConfigurationsexactly once (with the Key Vault reference). - Do the one-time DNS/CNAME for DCV, let the custom domain bind succeed, then remove the CNAME once you see the cert in APIM.
Hope this helps!
If the resolution was helpful, kindly take a moment to click on and click on Yes for was this answer helpful. And, if you have any further query do let us know.