Hi Team,
I am trying to install the KeyVaultForLinux extension (4.x) on an Ubuntu 24.04 VM, but I am encountering an issue during deployment.
Environment Details:
- Using the VM's Managed Identity for authentication.
- The Managed Identity already has the required access permissions to the Azure Key Vault (AKV).
Issue: The deployment fails during the certificate and private key validation step. The error indicates a certificate/key mismatch.
However:
- The certificate stored in the Key Vault is valid and has been in use for a long time without any issues.
- The certificate was originally uploaded to the Key Vault as a PFX.
- Manual validation of the certificate and private key does not show any mismatch.
- Other services using the same certificate have been working successfully. (EX: in AppGW with AKV linked)
Since the certificate can be retrieved successfully but the validation fails only within the KeyVaultForLinux extension, I would like to understand:
- Is there any bug from Microsoft side which is failing for this validation?
- Are there additional validation requirements enforced by the extension that could cause this mismatch error?
- Any guidance would be greatly appreciated.
Error:
2026-08-28 06:42:55: <info> [CertificateManager] Installing previous version '91129cb365f64212afe20097a46f5d30' of 'https://<ForSecurityRemovedAKVName>.vault.azure.net/secrets/<RemovingCertName>'
2026-08-28 06:42:55: <debug> [AuthClientDelegator] delegating to MSI auth client
2026-08-28 06:42:55: <debug> [AuthClient] acquiring token
2026-08-28 06:42:55: <debug> [UnixKeyVaultHttpClient] Using CAfile for TLS: /etc/ssl/certs/ca-certificates.crt
2026-08-28 06:42:55: <debug> [UnixKeyVaultHttpClient] Using CApath for TLS: /etc/ssl/certs
2026-08-28 06:42:55: <info> [UnixCertificateStore] attempting to open store '/etc/nginx/test-ssl'
2026-08-28 06:42:55: <info> [Certificate] Loaded 2 intermediate/root certificate(s) from PEM
2026-08-28 06:42:55: <error> [CertificateManager] Refreshing 'https://<ForSecurityRemovedAKVName>.vault.azure.net/secrets/<RemovingCertName>' failed with exception: InitFromPEM: Mismatched X509 and private key.: error:05800074:x509 certificate routines::key values mismatch
2026-08-28 06:42:55: <error> [CertificateManager] Failed to install previous version '91129cb365f64212afe20097a46f5d30' of 'https://<ForSecurityRemovedAKVName>.vault.azure.net/secrets/<RemovingCertName>'
2026-08-28 06:42:55: <error> [CertificateManager] Failed to download one or more certificates.
2026-08-28 06:42:55: <error> [CertificateManager] Retrying after failed download cycle.
2026-08-28 06:42:55: <info> [CertificateManager] Next poll in 45 seconds.
2026-08-28 06:42:55: <info> [UnixCertificateManager] Checking state of termination event with a timeout of 45999
2026-08-28 06:43:41: <debug> [CertificateManager] POLLING_RANDOMIZATION_RANGE_SEC: 300, RandomMS: 179000
2026-08-28 06:43:41: <info> [CertificateManager] Starting refreshing observed certificates...
2026-08-28 06:43:41: <info> [CertificateManager] Beginning refresh for: https://<ForSecurityRemovedAKVName>.vault.azure.net/secrets/<RemovingCertName>
2026-08-28 06:43:41: <debug> [AuthClientDelegator] delegating to MSI auth client
2026-08-28 06:43:41: <debug> [AuthClient] acquiring token
2026-08-28 06:43:41: <debug> [UnixKeyVaultHttpClient] Using CAfile for TLS: /etc/ssl/certs/ca-certificates.crt
2026-08-28 06:43:41: <debug> [UnixKeyVaultHttpClient] Using CApath for TLS: /etc/ssl/certs
2026-08-28 06:43:42: <info> [CertificateManager] Installing previous version '91129cb365f64212afe20097a46f5d30' of 'https://<ForSecurityRemovedAKVName>.vault.azure.net/secrets/<RemovingCertName>'
2026-08-28 06:43:42: <debug> [AuthClientDelegator] delegating to MSI auth client
2026-08-28 06:43:42: <debug> [AuthClient] acquiring token
2026-08-28 06:43:42: <debug> [UnixKeyVaultHttpClient] Using CAfile for TLS: /etc/ssl/certs/ca-certificates.crt
2026-08-28 06:43:42: <debug> [UnixKeyVaultHttpClient] Using CApath for TLS: /etc/ssl/certs
2026-08-28 06:43:42: <info> [UnixCertificateStore] attempting to open store '/etc/nginx/test-ssl'
2026-08-28 06:43:42: <info> [Certificate] Loaded 2 intermediate/root certificate(s) from PEM
2026-08-28 06:43:42: <error> [CertificateManager] Refreshing 'https://<ForSecurityRemovedAKVName>.vault.azure.net/secrets/<RemovingCertName>' failed with exception: InitFromPEM: Mismatched X509 and private key.: error:05800074:x509 certificate routines::key values mismatch
2026-08-28 06:43:42: <error> [CertificateManager] Failed to install previous version '91129cb365f64212afe20097a46f5d30' of '<ForSecurityRemovedAKVName>.vault.azure.net/secrets/<RemovingCertName>'
2026-08-28 06:43:42: <error> [CertificateManager] Failed to download one or more certificates.
2026-08-28 06:43:42: <error> [CertificateManager] Retrying after failed download cycle.
2026-08-28 06:43:42: <info> [CertificateManager] Next poll in 33 seconds.
2026-08-28 06:43:42: <info> [UnixCertificateManager] Checking state of termination event with a timeout of 33999