@Digit Labs
Thank you for the quick response!
A common reason for the import to fail is that openssl may add certain commentary text in the .pem file. For example, if you convert a PFX to a PEM using the below command:
openssl pkcs12 -in cert.pfx -out cert.pem
Then using "cat cert.pem", you might see something like:
Bag Attributes
localKeyID: D4 2F E7 46 EA BC 7F 00 35 1F 1A 2F 33 07 81 5F 31 7F 90 E7
subject=/CN=example.com
issuer=/CN=example.com
-----BEGIN CERTIFICATE-----
(etc)
Azure Key Vault does not understand any text in the .pem file that is not between -----BEGIN etc----- and -----END etc----- marks.
You can try to avoid these comments by concatenating the certificate (i.e. public key) and the private key together in a cat command:
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
cat cert.pem key.pem > tobeimported.pem
The above command will produce a tobeimported.pem file that Key Vault understands.
Reference: https://github.com/MicrosoftDocs/azure-docs/issues/23558
If you're still running into issues can you please email me with the info below, this way I can enable a free one-time technical support request for you so our support engineers can take a closer look into your issue.
Email: AzCommunity@microsoft.com
Subject: ATTN - James Tran
Body:
Azure Subscription ID
Link to this issue
If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.