Answer accepted by question author
AI answer
The behavior matches a Key Vault access/permissions issue on the vaults that hold the App Service certificate secrets. The sync call in the portal can show βsuccessfulβ at the App Service side while the underlying Key Vault access still blocks updating or reading the certificate secrets.
Use the following checks and fixes end to end:
- Confirm the certificate is domain-verified and renewed
- In the App Service Certificate resource β Certificate Configuration:
- Ensure Step 2: Verify shows the domain as verified (no Pending issuance or renewal pending due to verification).
- If the certificate is expired or close to expiry, renew it (or recreate it) and ensure the new certificate has a later expiration date.
- Verify the Key Vault used by the App Service Certificate
- In the App Service Certificate β Certificate Configuration > Step 1: Store:
- Confirm the certificate is stored in a Key Vault (green checkmark).
- Confirm the Key Vault is in the same subscription and resource group as the certificate.
- Fix Key Vault access policies for App Service certificate integration For each Key Vault that should receive the synced certificate:
- Go to Key Vaults β [Your Vault] β Access policies and verify that the service principals for App Service certificates exist with the required permissions:
-
Microsoft Azure Web Service (Microsoft.Azure.WebSites)- Secret permissions: Get
- Certificate permissions: Get
-
Azure Certificate Registration (Microsoft.Azure.CertificateRegistration)- Secret permissions: Get, List, Delete
- Certificate permissions (where applicable): Get, List
-
- If either entry is missing or has fewer permissions:
- Select Add Access Policy.
- Either choose the Key Vault Certificate Manager template or manually:
- Select principal
Microsoft.Azure.WebSitesandMicrosoft.Azure.CertificateRegistration. - Assign the permissions listed above.
- Select principal
- Save the changes.
If using Azure RBAC instead of access policies, ensure equivalent role assignments exist at the vault scope, for example via:
az role assignment create --role "Key Vault Secrets Officer" --assignee "f3c21649-0979-4721-ac85-b0216b2cf413" --scope /subscriptions/{subscriptionid}/resourcegroups/{resource-group-name}/providers/Microsoft.KeyVault/vaults/{key-vault-name}
az role assignment create --role "Key Vault Certificate User" --assignee "abfa0a7c-a6b6-4736-8310-5855508787cd" --scope /subscriptions/{subscriptionid}/resourcegroups/{resource-group-name}/providers/Microsoft.KeyVault/vaults/{key-vault-name}
(Adjust subscription, resource group, and vault name as needed.)
- Ensure Key Vault network access does not block Azure services
- If the Key Vault uses private endpoints or firewall rules, make sure it allows trusted Azure services or that the App Service certificate back-end can reach the vault. A blocked data plane can prevent the secret from being updated even if permissions are correct.
- Force a re-sync of the App Service certificate Once the access policies/roles and network access are correct:
- In the App Service Certificate blade, use Rekey and Sync β Sync to push the current certificate to all linked App Service apps and vault bindings.
- Then, for each web app using the certificate:
- Go to TLS/SSL Settings β Private Key Certificates (.pfx) and confirm the certificate is present.
- Under TLS/SSL bindings, confirm the binding uses the renewed certificate. If it still shows the old one, re-bind it to the updated certificate.
- As a last resort: manual export/import If the certificate is correctly renewed and domain-verified, and the Key Vault contains the correct secret but the automatic sync to the apps still fails:
- In the Key Vault, locate the certificate secret and download the PFX.
- In the target App Service app β TLS/SSL Settings β Private Key Certificates (.pfx), use Upload Certificate with the PFX (password is typically blank for Azure-downloaded PFX).
- Re-bind the custom domains to this uploaded certificate.
This bypasses the automatic App Service certificate sync, so it is recommended only as a workaround; fixing the Key Vault access policies and network configuration is preferred so that future renewals sync automatically.
References:
