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--