You’re running into this because Logic Apps can’t use the raw Base64 string from Key Vault as-is.
When you pull a certificate from Key Vault, the secret value is the full PFX encoded in Base64.
Logic Apps expects a clean Base64 PFX string with the correct password, and the most common failure is either:
- The secret is stored as a Key Vault certificate object, not a secret, or
The value includes extra JSON fields instead of being the raw Base64 PFX.
What actually works:
In Key Vault, go to Certificates → your cert → Download in PFX format.
Confirm the certificate also created a secret entry. The secret must contain only the Base64 PFX.
In your Logic App, reference that secret directly:
"authentication": {
"type": "ClientCertificate",
"pfx": "@{body('Get_Certificate_Secret')['value']}",
"password": "@{body('Get_Certificate_Password')['value']}"
}
Make sure you use Get Secret, not Get Certificate. The Certificate object returns metadata and won’t work. You must retrieve:
The certificate’s secret, which is the Base64 PFX
The password stored as a separate secret
Once you switch to the secret version of the certificate, the BadRequest error disappears.You’re running into this because Logic Apps can’t use the raw Base64 string from Key Vault as-is. When you pull a certificate from Key Vault, the secret value is the full PFX encoded in Base64. Logic Apps expects a clean Base64 PFX string with the correct password, and the most common failure is either:
The secret is stored as a Key Vault certificate object, not a secret, or
The value includes extra JSON fields instead of being the raw Base64 PFX.
What actually works:
In Key Vault, go to Certificates → your cert → Download in PFX format.
Confirm the certificate also created a secret entry. The secret must contain only the Base64 PFX.
In your Logic App, reference that secret directly:
"authentication"
Make sure you use Get Secret, not Get Certificate. The Certificate object returns metadata and won’t work. You must retrieve:
The certificate’s secret, which is the Base64 PFX
The password stored as a separate secret
Once you switch to the secret version of the certificate, the BadRequest error disappears.