I generated pfx certificate using the following script:
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout security.key -out security.crt -subj "/CN=ourdomain.com" -days 3650
openssl pkcs12 -export -out security.pfx -inkey security.key -in security.crt -certfile security.crt
Next, i'm trying to add this certificate into our Azure Key Vault (into certificates section). After using this command:
$cer = Import-AzureKeyVaultCertificate -VaultName $vaultName -Name $certificateName -FilePath 'security.pfx' -Password $securepfxpwd
i get the following error:
Import-AzureKeyVaultCertificate : Private key is present in more than one item in certificate collection
This certificate is successfully used by our application and doesn't throw any errors in the process.