So I have been trying to upload a cert from keyvault to my azure we app. I followed this guide:
https://azure.github.io/AppService/2016/05/24/Deploying-Azure-Web-App-Certificate-through-Key-Vault.html
When trying to create the Microsoft.Web/certificates resource I get the error:
{
"Code": "BadRequest",
"Message": "The parameter KeyVault Certificate has an invalid value.",
"Target": null,
"Details": [
{
"Message": "The parameter KeyVault Certificate has an invalid value."
},
{
"Code": "BadRequest"
},
{
"ErrorEntity": {
"ExtendedCode": "51008",
"MessageTemplate": "The parameter {0} has an invalid value.",
"Parameters": [
"KeyVault Certificate"
],
"Code": "BadRequest",
"Message": "The parameter KeyVault Certificate has an invalid value."
}
}
],
"Innererror": null
}
I got the same error when trying to deploy when using this template as a reference: https://github.com/Azure/azure-quickstart-templates/tree/master/201-web-app-certificate-from-key-vault
I have tried with two different certs that are in use for us in production. When uploading the certs manually in the app service TLS/SSL settings -> Private Key Certificate the certs work as expected.
When downloading the secret uploaded with the PS script as a certificate it seams very small (1kb vs 5kb of the original cert) and I cannot open it with the cert password so my best guess is that there is something wrong with the upload.
I have no idea how to debug this futher.