Use Azure Key Vault with .NET or ASP.NET Core Applications

Ashish Patel
.NET Hub
Published in
2 min readJan 1, 2021

--

Store app settings in Azure Key Vault for .NET 6.x or ASP.NET Core 3.x applications

Azure Key Vault with .NET Applications

TL;DR

Azure Key Vault is a service that you can use to store secrets and other sensitive configuration data for an application. It allows you to define settings that can be shared among multiple apps, including apps running in App Service.
We will use Azure Key Vault to centralize storage and management of application settings for an .NET 5.0 (and later)/ASP.NET Core application. It builds a single key-value-based configuration object using settings from one or more data sources specified by an application.

Use Azure App Configuration with .NET or ASP.NET Core Applications

Key Vault allows you to separate your configuration data into sensitive and non-sensitive information. For example, you could use Application Settings to store some default settings but use Key Vault to store your API keys, connection strings, and passwords that your application depends on.

When you configure an application to connect to a Key Vault it gets added as a separate configuration source. You can then read values just as you would for any other configuration data.

var nonSensitiveSetting = Configuration[“EnableLogging”]; // read…

--

--

Ashish Patel
.NET Hub

Cloud Architect • 4x AWS Certified • 6x Azure Certified • 1x Kubernetes Certified • MCP • .NET • Terraform • DevOps • Blogger [https://bit.ly/iamashishpatel]