Certificate with thumbprint was not found in certificate store or has expired.

Ken Nye 20 Reputation points
2025-01-27T22:04:10.2666667+00:00

I created an APP on 2/16/2022 and a certificate that expires 2/16/2032. As of 1/10/25 I now get this error when I try to call the API

Certificate with thumbprint 'xxxxxxx' was not found in certificate store or has expired.

When I look in my Azure App registrations it show my app with a current and valid certificate.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Accepted answer
  1. SrideviM 5,720 Reputation points Microsoft External Staff Moderator
    2025-02-19T10:12:43.9166667+00:00

    Hello @Ken Nye

    The error usually occurs if the certificate added in Azure AD app registration is deleted in local certification store.

    I have one app registration with certificate named graphcert07 added in it:

    enter image description here

    Now, I ran certmgr.msc in Windows Run to open Certificate Manager and deleted graphcert07 certificate as below:

    enter image description here

    When I tried to connect Microsoft Graph PowerShell using that certificate, I too got same error like this:

    $tenantId = "tenantId"
    $clientId = "appId"
    $thumbprint = "65876F7BB07B2Cxxxxxxxxxxxx"
    
    Connect-MgGraph -ClientId $clientId -TenantId $tenantId -CertificateThumbprint $thumbprint
    

    enter image description here

    Even if the certificate is present in Azure AD app registration, it should also present in local certification store.

    In your case, open Certificate Manager and check whether certificate named Azure_cert thumbprint is present in it or not.

    If it’s not present, delete the existing certificate in Azure AD app registration and upload new certificate to it.

    I created one new certificate by running below PowerShell commands:

    $certname = "mygraphcert"    
    $cert = New-SelfSignedCertificate -Subject "CN=$certname" -CertStoreLocation "Cert:\CurrentUser\My" -KeyExportPolicy Exportable -KeySpec Signature -KeyLength 2048 -KeyAlgorithm RSA -HashAlgorithm SHA256
    
    Export-Certificate -Cert $cert -FilePath "C:/mycerts/$certname.cer"   ## Specify your preferred location
    

    enter image description here

    Now, I uploaded this new certificate to Azure AD app registration by deleting the old one:

    enter image description here

    When I tried to connect Microsoft Graph PowerShell using new certificate, I got the response successfully as below:

    $tenantId = "tenantId"
    $clientId = "appId"
    $thumbprint = "91792D97E4xxxxxxxxxxxxxxx"
    
    Connect-MgGraph -ClientId $clientId -TenantId $tenantId -CertificateThumbprint $thumbprint
    Get-MgUserDefaultCalendar -UserId "userobjectId"
    

    enter image description here


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.            User's image

    If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most 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.