Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to refer to a certificate in Azure Key Vault via a file name?

In the scenario for this question I am using a library that takes a certificate path as a parameter.

Does that mean that it is not possible for me to store my certificate in Key Vault?

like image 586
Kirsten Avatar asked Sep 19 '18 03:09

Kirsten


1 Answers

Does that mean that it is not possible for me to store my certificate in Key Vault?

It is possible, but you have to give it a Name (key) to access it.

When you add/import x.509 certificates to Azure Key Vault Certificates, you give it a name (which acts as a unique key for that certificate), and you access that certificate by that name.

More info here: https://blogs.technet.microsoft.com/kv/2016/09/26/get-started-with-azure-key-vault-certificates/

Now, with regards to your other question, I am assuming you are wondering how to access a certificate from an Azure function. In your other question, you have this:

ApiSettings["SigningCertPath"]

And you indicated, you are using a (3rd party) library which picks the signing certificate path, and presumably loads that certificate. I do not know how your (3rd party) library works, or if it even works with Azure Key Vault. But it appears your library is loading the cert from a file. You did not mention if you still would like to do it that way.

But as alternative, you can load/import your certificate into your Function App (Platform features > SSL). Besides taht, you also need to add this entry to the Application Settings (on Azure portal): key WEBSITE_LOAD_CERTIFICATES and the value of *. This loads all certificates in your SSL bindings and into your Function App's certificate store. Then your function can read/get the certificate as you would get it from a local certificate store.

You can do the above instead of storing your certs in Key Vault. But you can also have all your other certs in Key Vault and only store the client certificate you need to access Key Vault from within your function.

like image 132
Frank Fajardo Avatar answered Jan 02 '23 13:01

Frank Fajardo