Issue with creating a Azure VM in Packer using Azure Automation Account Cert

The Packer code works if I user a service principal and a password. But I’m trying to create Azure VM using the an Azure automation account cert. I get the following error:
“==> azure-arm: Getting tokens using client certificate
Build ‘azure-arm’ errored: Error reading certificate: Did not find private key in pem file”

I used the following steps to generate the cert (“pfx”) and uploaded the cert to associate it with the Azure automation account.

  1. openssl req -newkey rsa:4096 -nodes -keyout “cert.key” -out “cert.csr”

  2. openssl x509 -signkey “cert.key” -in “cert.csr” -req -days 365 -out “cert.crt”

  3. openssl pkcs12 -export -out “cert.pfx” -inkey “cert.key” -in “cert.crt”

I load the “pfx” in Azure and associate it with the automation account. I use the same in packer.

“builders”: [{
“type”: “azure-arm”,
“client_id”: “xxxxxx”,
“client_cert_path”: “cert.pfx”,
“tenant_id”: “xxxxxx”,
“subscription_id”: “xxxxx”,

Is using “Azure Automation Account” cert supported in Packer? Any thoughts would be much appreciated.

Regards