Reputation: 452
I purchase an App Service Certificate, and when I connected it up with the Service Fabric I got the below deployment error. I can find documentation to upload a PFX in JSON format, but I cannot find anything about converting the certificate into JSON format. It seems you can't even export the certificate, is this the case? How do I remedy this?
{
"status": "Failed",
"error": {
"code": "ResourceDeploymentFailure",
"message": "The resource operation completed with terminal provisioning state 'Failed'.",
"details": [
{
"code": "CertificateImproperlyFormatted",
"message": "The data retrieved from https://XXXX.vault.azure.net/secretsYYY/ZZZ is not deserializable into JSON."
}
]
}
}
Upvotes: 0
Views: 491
Reputation: 452
Ok figured it out, as per my comments you can actually download the certificate via the Vault and it doesn't have a password at all. So you can then use it how you want.
$secretRetrieved = Get-AzureKeyVaultSecret -VaultName 'vault' -Name 'name'
$pfxBytes = [System.Convert]::FromBase64String($secretRetrieved.SecretValueText)
[io.file]::WriteAllBytes("D:\Development\Tools\Service-Fabric-master\certificate.pfx", $pfxBytes)
Upvotes: 2