I am currently using a PowerShell to connect to Azure AD through Connect-AzureAD with Certificate and SPN. This is the part of my script where i create a self signed certificate, export to my local store on my machine and load it afterwards:
$thumb = (New-SelfSignedCertificate -CertStoreLocation cert:\localmachine\my -DnsName com.foo.bar -KeyExportPolicy Exportable -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -NotAfter $notAfter).Thumbprint
$pwd = ConvertTo-SecureString -String $pwd -Force -AsPlainText
Export-PfxCertificate -cert "cert:\localmachine\my\$thumb" -FilePath $certPath -Password $pwd
# Load the certificate
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate($certPath, $pwd)
$keyValue = [System.Convert]::ToBase64String($cert.GetRawCertData())
The problem is how to do this in VSTS Online with a similar PowerShell script? Is there also such a cert store? I have already an existing .pfx which i need to use, a creation of a new one is not neccessary.