Home > Asp.net MVC > Get and set Azure Key Vault value in C#

Get and set Azure Key Vault value in C#

Overview:
Azure key vault provides a store where you can manage all your keys and secrets effectively. So now, what is the difference between keys
and secrets? It’s simple concept – keys are referring to terms like your encryption keys, however secrets can be any sensitive data like your SQL database connection string or storage access credentials etc.
Azure key vault service is backed by HSM i.e. hardware security modules using certain state of the art algorithms. In simple words – HSM is a mechanism which is used to manage and store these cryptographic keys securely.

Let’s setup Azure KeyVault:

Install NuGet package :
1.Microsoft.Azure.KeyVault
2.Microsoft.IdentityModel.Clients.ActiveDirectory

Add keys in web configuration files:

Get value from vault:

Code:

Set Value of Vault:

 

 

This Article is TAGGED in , . BOOKMARK THE permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">