Forum Discussion

JeremyTBradshaw's avatar
JeremyTBradshaw
Iron Contributor
Sep 11, 2020
Solved

Problem uploading PFX cert to Azure Automation account (now password prompt)

Wondering if anyone knows the secret solution for this:  In Azure Portal, while under an Automation Account > Certificates > Add a certificate, I can successfully browse to and upload my PFX certific...
  • hspinto's avatar
    Sep 13, 2020

    JeremyTBradshaw 

     

    AFAIK, there isn't any issue with the Certificate upload UI in Azure Automation. Once you select a valid PFX file, the UI adds automatically two fields, being one them the password field, as you can see by the screenshot below. Are you sure the PFX was correctly generated? See below a sample PowerShell that generates a valid PFX.

     

    $Cert = New-SelfSignedCertificate -DnsName "CertificateName" -CertStoreLocation cert:\LocalMachine\My -KeyExportPolicy Exportable -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -NotAfter (Get-Date).AddMonths(12) -HashAlgorithm SHA256
    
    $CertPassword = ConvertTo-SecureString $PfxCertPlainPassword -AsPlainText -Force
    Export-PfxCertificate -Cert ("Cert:\localmachine\my\" + $Cert.Thumbprint) -FilePath $certPath -Password $CertPassword -Force | Write-Verbose 
    

     

     

Resources