How to handle APIM managed certificate suspension in Bicep?

Westman Carl 25 Reputation points
2025-08-19T08:21:19.1333333+00:00

I have this Bicep code

resource apiManagementService 'Microsoft.ApiManagement/service@2024-05-01' = {
  name: apiManagementServiceName
  location: location
  sku: {
    name: sku
    capacity: skuCount
  }
  properties: {
    hostnameConfigurations: empty(customDomain)
      ? null
      : [
          {
            hostName: customDomain
            type: 'Proxy'
            negotiateClientCertificate: false
            defaultSslBinding: false
            certificateSource: 'Managed'
          }
        ]
    publisherEmail: publisherEmail
    publisherName: publisherName
    apiVersionConstraint: {
      minApiVersion: '2019-12-01'
    }
  }
  identity: identityType == 'None'
    ? null
    : {
        type: identityType
      }
  tags: resourceTags
}


However I cannot deploy this atm because I get

"Update APIM service 'shared-azure-api-management-sf57piwqzokg6' failed. The HostnameConfiguration includes a new Managed Certificate Request, which is temporarily not supported during update from August 15th 2025 to March 15th 2026. All the configured custom domains with Managed Certificate can still be reachable without any impact. Please refer to API Management documentation here: https://learn.microsoft.com/en-us/azure/api-management/breaking-changes/managed-certificates-suspension-august-2025"

How am I supposed to get this to deploy while also keeping my cert and custom domain active?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
{count} votes

Accepted answer
  1. deep sanchaniya 75 Reputation points
    2025-08-20T15:08:39.5566667+00:00

    Problem

    The Bicep deployment for an Azure API Management service fails with an error stating that new managed certificate requests are temporarily suspended from August 15, 2025, to March 15, 2026. The goal is to deploy other changes to the API Management service while keeping the existing custom domain and managed certificate active.


    Solution

    The core issue is that the Bicep code attempts to update the hostnameConfigurations section, which triggers a new managed certificate request, leading to the deployment failure. To work around this, you must temporarily stop sending the hostnameConfigurations section in your Bicep template during the suspension window.

    Here are the specific actions to take:

    Remove or skip the hostnameConfigurations section: The most direct solution is to conditionally remove the hostnameConfigurations block from your Bicep template. This prevents the deployment from attempting to create or update the managed certificate, allowing other changes (like updates to APIs, products, or policies) to succeed. Your existing managed certificate will remain valid and will be automatically renewed by Azure.

    Split your Infrastructure as Code (IaC): For a more robust approach, you can separate your Bicep code into two parts. One template would manage the core service-level settings (like sku, location, publisherEmail, etc.), while a separate, independent template would manage the content (APIs, products, policies, etc.) of the API Management service. This allows you to deploy content updates without touching the service's configuration, including the hostnameConfigurations.

    Use a Key Vault certificate (Alternative): If you must add or change a custom domain during the suspension period, you can't use a new managed certificate. Instead, you would need to use a certificate stored in Azure Key Vault. This requires updating the hostnameConfigurations to reference the Key Vault ID and a certificate secret, instead of using the 'Managed' certificate source. This is a more involved change but is necessary if you need to onboard a new custom domain during this specific timeframe.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Sina Salam 23,931 Reputation points Volunteer Moderator
    2025-08-19T13:08:59.8166667+00:00

    Hello Westman Carl,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are in need of how you can handle APIM managed certificate suspension in Bicep, and keeping your certificate + custom domain active.

    Your Bicep deployment fails because it's attempting to add or modify the managed certificate configuration within this suspension window. You already have a working custom domain with a managed cert and you just need deployments to succeed (no domain change) by keeping the domain and cert untouched; deploy other changes by:

    I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.