An Azure service that provides a hybrid, multi-cloud management platform for APIs.
APIM custom domain disappearing after added
When adding a Custom Domain gateway in test apim, after adding hostname, .pfx, and password, it adds successfully without errors then just disappears after a few seconds / refresh.
Azure API Management
-
Pravallika KV • 11,030 Reputation points • Microsoft External Staff • Moderator
2026-03-06T19:34:50.7166667+00:00 Hi Zack H,
Thanks for reaching out to Microsoft Q&A.
Please share below details:
- What APIM tier you’re on?
- Is it your first custom gateway hostname or a second one?
- Any errors in the Activity Log or portal notification
- On the Custom domains blade, after you fill in Hostname, PFX and password, you must click Add (for the endpoint) and then Save (top of the page). If you navigate away or refresh without hitting Save, the entry is discarded.
-
Zack H • 0 Reputation points
2026-03-06T19:42:08.7433333+00:00 - Basicv2 (I've added a custom domain to another environment that was also Basicv2 without issues)
- It is the first custom domain hostname. there is also built-in gateway with a different hostname
- No errors relating to the update/add. there is one that says Failed for "CALL MANAGEMENT API" with this but it might be unrelated.
Request processing failed due to internal error.- Yes I do click Add then Save.
-
Pravallika KV • 11,030 Reputation points • Microsoft External Staff • Moderator
2026-03-06T20:53:17.11+00:00 In most cases, this issue occurs because the certificate isn’t in the correct format.
- The certificate must be a PFX containing the full chain and private key (not just the server certificate).
- It must use RSA (2048 or 4096 bits); ECC certificates are not supported.
- The PFX must be password-protected.
- The domain name must match the CN or SAN in the certificate.
- Custom domains are not supported on the Consumption tier.
Possible Fix Steps:
Re-export your SSL certificate properly:
Using Windows:
Import the certificate (with private key) into the Windows certificate store.
- Open MMC =>Certificates =>Personal =>Certificates.
- Right-click your certificate =>All Tasks =>Export.
- Choose Yes, export the private key.
- Select Include all certificates in the certification path.
- Export as .pfx with a strong password.
Using OpenSSL (Bash):
openssl pkcs12 -export -out cert_bundle.pfx \ -inkey your_domain.key \ -in your_domain.crt \ -certfile intermediate.crtThis ensures the PFX meets APIM requirements and should prevent the custom domain from disappearing after adding it.
Try via CLI/ARM if the portal still drops it:
az apim update \ --name MyApimService \ --resource-group MyRG \ --set hostnameConfigurations='[{ "type":"Proxy", "hostName":"api.contoso.com", "certificate":{ "encodedCertificate":"<base64-pfx>", "certificatePassword":"<your-password>" } }]' -
Zack H • 0 Reputation points
2026-03-09T15:14:39.1633333+00:00 I've re-exported it and it is still dropping from the portal. I checked Activity Log and see this in the JSON on error Failed for "CALL MANAGEMENT API".
"errorMessage": "{\"error\":{\"code\":\"MethodNotAllowedInPricingTier\",\"message\":\"Method not allowed in BasicV2 pricing tier\",\"details\":null}}",Tried using powershell and get a similar error:
Code: OperationSupportedInSkuForApiVersionsMessage: Operation on BasicV2 SKU is only supported in the api-versions 2023-03-01-preview,2023-05-01-preview,2023-09-01-preview,2024-05-01,2024-06-01-preview,2024-10-01-preview,2025-03-01-preview,2025-09-01-preview.
Our Dev environment is also Basicv2 and did not give these errors when doing the same process.
-
Pravallika KV • 11,030 Reputation points • Microsoft External Staff • Moderator
2026-03-09T20:55:54.6766667+00:00 "errorMessage": "{\"error\":{\"code\":\"MethodNotAllowedInPricingTier\",\"message\":\"Method not allowed in BasicV2 pricing tier\",\"details\":null}}",The above error occurs because the method you're calling isn’t allowed in BasicV2 at the API version you’re using. Dev worked likely because it used a supported API version. The error is coming before the API even executes, meaning it’s a tier limitation, not a syntax or configuration problem.
Code: OperationSupportedInSkuForApiVersions- PowerShell is explicitly telling which API versions support this operation on BasicV2.
- If you're using an older or different API version in the call, it will fail, even if the operation works in higher SKUs like Standard or Enterprise.
Use one of the supported API versions listed in the error (
2024-05-01,2024-06-01-preview, etc.) or upgrade your SKU to Standard or higher. -
Zack H • 0 Reputation points
2026-03-12T15:24:28.48+00:00 But adding the custom domain is originally done in the Azure Portal in the API management service, why would it be using an unsupported API version? Is there a way to check in the portal? I'm still uncertain why it worked in Dev but not Test.
-
Pravallika KV • 11,030 Reputation points • Microsoft External Staff • Moderator
2026-03-12T22:12:00.2533333+00:00 Azure Portal UI is just a front-end for Azure Resource Manager (ARM) API calls. Even if you configure something manually in the portal, behind the scenes the portal still calls a specific ARM REST API version. If that API version performs an operation not supported by your SKU, you can see errors like the one you got.
- If the portal (or your script) calls an API version that doesn’t support the operation for BasicV2, Azure blocks it with
MethodNotAllowedInPricingTier. - Dev might use a different APIM SKU (e.g., Developer/Standard instead of BasicV2), or
The custom domain was created earlier before the API restriction changed.
How to check in the portal:
- Open the Azure Portal.
- Press F12 =>Network tab.
- Perform the custom domain action.
- Look for the request to
management.azure.comand check theapi-versionin the URL.
uri: "https://management.azure.com/providers/Microsoft.Billing/billingAccounts?api-version=2020-05-01&expand=billingProfiles"If your script uses an older API version than the portal request, that’s the reason for the error.
- Go to API Management =>Activity Log
- Find the failed Update operation
- Open JSON details to see what operation was called.
Also verify both environments have the same APIM SKU in Overview =>Pricing tier.
- If the portal (or your script) calls an API version that doesn’t support the operation for BasicV2, Azure blocks it with
Sign in to comment