简体   繁体   中英

How to fix “The private key is not present in the X.509 certificate”

at the moment I´m working in azure with azure automation and automation account. For executing a runbook I want to authenticate me with a service principal + certificate. Unfortunately I get the error message "The private key is not present in the X.509 certificate". I will use:

Add-AzureRmAccount -ServicePrincipal -Tenant xxx -ApplicationId xxx -CertificateThumbprint xxx

But with Login-AzureRmAccount and Connect-AzureRmAccount I get the same error message.

What have I done so far? Since I´m working in a big company I can´t use a self-signed certificate. Our team have created a .cer-File and .key (Private Key) file for me. After some testing I find out that I need something like this:

Example

Furthermore, I know that I can get this with an .pfx file but this is not accepted from the other team, which will import the certificate to my service principal since they only accept .cer files.

How can I get a .cer file with an public key included?

Thanks a lot!

Your certificate needs to include the private key if you want to sign in with it, which from the error message appears missing. A certificate with the private key included should have a file name of ~.pfx. For reference, check the MS doco here : "Clients which sign in with the service principal also need access to the certificate's private key"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM