Can't upload an SSL certificate to Azure WebApp

Sergiy Korzh 0 Reputation points
2023-06-08T20:03:33.9133333+00:00

I'm trying to upload my SSL certificate (a .pfx file), but I got the following response:

At least one certificate is not valid. Certificate failed validation because it could not be loaded

That's strange because this certificate was issued a few hours ago, and it looks totally OK if I add it to the Certificate Manager on Windows (see the screenshot below):
Certificate_KorzhStar_sshot

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} votes

1 answer

Sort by: Most helpful
  1. Manu Philip 20,491 Reputation points MVP Volunteer Moderator
    2023-06-08T21:16:08.57+00:00

    The reason for the error could be the certificate is not meeting the azure webapp requirements. You can try the following steps to resolve the issue.

    • Re-encrypt the pfx file in a windows machine so that you can encrypt the file using a password. Use the following command in PowerShell. Use a preferred password
    Import-PfxCertificate -FilePath "path" -CertStoreLocation Cert:\LocalMachine\My -Password (ConvertTo-SecureString -String 'password' -AsPlainText -Force) -Exportable
    
    • Up on successful completion, you will find a thumbprint. Copy the thumbprint and use it in the following command to export the certificate
    Export-PfxCertificate -Cert Microsoft.PowerShell.Security\Certificate::LocalMachine\My\<thumbprint> -FilePath 'newPfxcert.pfx' -Password (ConvertTo-SecureString -String 'password' -AsPlainText -Force)
    

    The exported certificate should be usable in app services without any issues.


    --please don't forget to upvote and Accept as answer if the reply is helpful--

    1 person found this answer helpful.

Your answer

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