API Management Key Vault certificates work well right up until a certificate stops rotating, a custom domain starts throwing TLS errors, or Key Vault refuses access from behind a firewall. This runbook helps Azure admins and platform engineers get API Management, managed identity and Key Vault working together reliably.
API Management Key Vault certificates: the moving parts
When API Management uses certificates from Key Vault, validate four layers:
- Certificate source: for custom domain TLS, store it in Key Vault as a certificate, not only as a raw secret.
- Identity: APIM needs a system-assigned or user-assigned managed identity. With the Key Vault firewall enabled, Microsoft’s guidance specifically calls for the system-assigned identity.
- Authorization: the identity needs data-plane access to certificate material, through access policies or Azure RBAC (commonly Key Vault Secrets User).
- Network reachability: Key Vault firewall, trusted Microsoft services bypass, service endpoints and NSG rules.
Most APIM and Key Vault issues aren’t really certificate issues. They’re identity, permission, identifier or firewall issues that surface as TLS errors.
Quick triage checklist
| Check | What good looks like | Common failure symptom |
|---|---|---|
| Managed identity | Enabled on the APIM instance; system-assigned preferred when the Key Vault firewall is on. | APIM can’t list or select the certificate, or the custom domain update fails. |
| Key Vault permission model | Access policy or RBAC grants the APIM identity get/list on the required data. | 403 from Key Vault, empty certificate picker, failed refresh. |
| Certificate identifier | A versionless identifier for automatic rotation. | Renewed certificate exists but APIM keeps using the old version. |
| Firewall | Trusted Microsoft services bypass enabled where required, and APIM VNet requirements met. | Works with the firewall open, fails when locked down. |
| Custom domain update | Allow for infrastructure update time; Microsoft notes 15 minutes or longer depending on tier and scale. | Admins assume failure too early and start changing other settings. |
Step 1: Confirm the API Management identity
Open the APIM instance and go to Managed identities. For a simple, supportable setup, enable the system-assigned managed identity. User-assigned identities suit reusable patterns, but Microsoft’s documentation says a firewalled Key Vault requires the instance’s system-assigned identity for certificate access.
# Enable the system-assigned identity on an existing APIM instance
$apim = Get-AzApiManagement -ResourceGroupName $resourceGroupName -Name $apiManagementName
Set-AzApiManagement -InputObject $apim -SystemAssignedIdentity
Step 2: Grant the right Key Vault data-plane access
Managing the vault resource (control plane) isn’t the same as reading certificate material from it (data plane). Check Key Vault > Access configuration to see which permission model the vault uses:
- Access policy model: grant the APIM identity Get and List on secrets.
- Azure RBAC model: assign a data-plane role, commonly Key Vault Secrets User.
- Scope: use the narrowest practical scope. Vault level is common; certificate level works for tighter environments.
Document which identity is supposed to read which certificate.
Step 3: Fix Key Vault firewall gotchas
With the firewall disabled, APIM still needs Entra authentication and authorization. With it enabled, validate:
- APIM has a system-assigned managed identity.
- Key Vault allows trusted Microsoft services to bypass the firewall where the documented scenario requires it.
- If APIM is in a virtual network, subnet and NSG rules allow outbound traffic to the Azure Key Vault and Microsoft Entra ID service tags.
- Your admin client IP is allowed temporarily if the portal needs to browse certificates during setup, and removed afterwards.
Step 4: Use a versionless certificate identifier
This is the classic rotation trap. If you expect APIM to pick up renewals automatically, don’t paste a version-specific identifier.
| Identifier style | Example shape | Rotation behavior |
|---|---|---|
| Versionless | https://vault-name.vault.azure.net/certificates/api-contoso-com | Use for automatic rotation. |
| Versioned | https://vault-name.vault.azure.net/certificates/api-contoso-com/<version> | Pinned; future renewals won’t flow through. |
Step 5: Know where the certificate is used
- Custom domain TLS: secures the gateway or developer portal endpoints. DNS, host names and the certificate subject or SAN must line up.
- Client certificate validation: secures inbound client-to-APIM requests, with policy expressions for certificate checks.
- Backend certificates: secure APIM-to-backend connections. Don’t confuse these with client certificates when troubleshooting mTLS.
- CA certificates: trusted roots and intermediates in supported tiers, with a documented limit of 10 per instance.
Troubleshooting runbook: from 403 to green check
- Confirm the APIM identity principal ID. If someone disabled and re-enabled the system-assigned identity, the principal changed and old Key Vault permissions no longer apply.
- Check the Key Vault permission model actually configured on the vault.
- Test for firewall impact. If opening the firewall fixes it, correct the trusted services, VNet, service endpoint, NSG or private networking design.
- Inspect the certificate identifier: versioned means pinned, versionless means rotation-friendly.
- Validate the certificate. Custom domain certificates need a private key and matching subject or SAN; uploaded PFX files should include the full chain where required.
- Allow time for infrastructure updates, especially on larger or multi-region instances.
- Refresh manually if needed. Key Vault updates are picked up within a documented refresh window, and the portal or management API can force a refresh.
Automation guardrails worth adding
- Inventory APIM certificate references and flag versioned IDs where rotation is expected.
- Alert before expiry with Key Vault lifetime actions or Azure Monitor.
- Track identity drift by recording APIM principal IDs.
- Document firewall exceptions so a temporary admin IP doesn’t become permanent.
- Use infrastructure as code for the identity, Key Vault permissions, custom domain binding and DNS.
API Management Key Vault certificates stay reliable when identity, permission, network and identifier stay aligned. For backend authentication and named values, see Azure API Management managed identity troubleshooting, and for the same pattern in App Service, App Service Key Vault reference fixes.
Last reviewed: October 2026
Sources
- Use managed identities in Azure API Management (Microsoft Learn)
- Configure a custom domain name for API Management (Microsoft Learn)
- Secure APIs using client certificate authentication (Microsoft Learn)
- Add a custom CA certificate in API Management (Microsoft Learn)
- Configure network security for Azure Key Vault (Microsoft Learn)
- Azure Key Vault RBAC guide (Microsoft Learn)
Discover more from Cloud Osprey
Subscribe to get the latest posts sent to your email.