Raiqub.AzureKeyVaultReference.Configuration
1.0.7-g52221d6fec
Prefix Reserved
See the version list below for details.
dotnet add package Raiqub.AzureKeyVaultReference.Configuration --version 1.0.7-g52221d6fec
NuGet\Install-Package Raiqub.AzureKeyVaultReference.Configuration -Version 1.0.7-g52221d6fec
<PackageReference Include="Raiqub.AzureKeyVaultReference.Configuration" Version="1.0.7-g52221d6fec" />
paket add Raiqub.AzureKeyVaultReference.Configuration --version 1.0.7-g52221d6fec
#r "nuget: Raiqub.AzureKeyVaultReference.Configuration, 1.0.7-g52221d6fec"
// Install Raiqub.AzureKeyVaultReference.Configuration as a Cake Addin #addin nuget:?package=Raiqub.AzureKeyVaultReference.Configuration&version=1.0.7-g52221d6fec&prerelease // Install Raiqub.AzureKeyVaultReference.Configuration as a Cake Tool #tool nuget:?package=Raiqub.AzureKeyVaultReference.Configuration&version=1.0.7-g52221d6fec&prerelease
Azure Key Vault Reference
The Raiqub Azure Key Vault Reference NuGet packages simplifies the integration of Azure Key Vault with your .NET applications by providing support for Azure Key Vault references in the IConfiguration
system.
🏃 Quickstart | 📗 Guide | 📦 NuGet
<hr />
Features
- Seamless integration of Azure Key Vault references with
IConfiguration
- Easy retrieval of secrets and configuration settings from Azure Key Vault
- Support for parsing Azure Key Vault references from strings
NuGet Packages
- Raiqub.AzureKeyVaultReference: provides support for parsing Azure Key Vault references
- Raiqub.AzureKeyVaultReference.Configuration: provides support for integrating Azure Key Vault references with
IConfiguration
Prerequisites
Before you begin, you'll need the following:
- .NET Standard 2.0 or .NET Core 6.0 installed on your machine
- An IDE such as Visual Studio, Visual Studio Code, or JetBrains Rider
Quickstart
To use the library, you can install the desired NuGet package(s) in your Web project and add the configuration provider. Here's an example of how to add the configuration provider:
var builder = WebApplication.CreateBuilder(args);
// ...
// Just before building WebApplication
builder.Configuration.AddAzureKeyVaultReferenceResolver();
var app = builder.Build();
Guide
To use the Azure Key Vault Configuration Provider, follow these steps:
- Set up Azure Key Vault: Ensure you have an Azure Key Vault instance created and the necessary permissions to access it.
- Install and configure the package: Install the NuGet package and add the necessary configuration to your application.
- Configure Azure Key Vault references: In your `appsettings.json` file or any other configuration source, add Azure Key Vault references using the `@Microsoft.KeyVault` syntax. For example:
{
"MySecret": "@Microsoft.KeyVault(SecretUri=https://your-keyvault.vault.azure.net/secrets/MySecret)",
"OtherSecret": "@Microsoft.KeyVault(VaultName=your-keyvault;SecretName=OtherSecret)"
}
- Retrieve configuration values: Access the configuration values as usual using the `IConfiguration` interface. The Azure Key Vault Configuration Provider will automatically fetch the secrets from Azure Key Vault and replace the references with the corresponding values.
using System.IO;
using Microsoft.Extensions.Configuration;
using Raiqub.AzureKeyVaultReference.Configuration;
var configuration = new ConfigurationManager()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.AddAzureKeyVaultReferenceResolver() // It must be always the last provider
.Build();
var mySecretValue = configuration["MySecret"];
- Parsing Azure Key Vault references: If you need to parse Azure Key Vault references from strings programmatically, you can use the `KeyVaultSecretReference` class provided by this package.
using Raiqub.AzureKeyVaultReference;
var reference = "@Microsoft.KeyVault(SecretUri=https://your-keyvault.vault.azure.net/secrets/MySecret)";
var parsedReference = KeyVaultSecretReference.Parse(reference);
// ParsedReference.VaultUri: "https://your-keyvault.vault.azure.net"
// ParsedReference.Name: "MySecret"
// ParsedReference.Version: null
Contributing
If something is not working for you or if you think that the source file should change, feel free to create an issue or Pull Request. I will be happy to discuss and potentially integrate your ideas!
License
This library is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.Caching.Memory (>= 6.0.1)
- Microsoft.Extensions.Configuration (>= 6.0.1)
- Microsoft.Extensions.Logging.Console (>= 6.0.0)
- Raiqub.AzureKeyVaultReference (>= 1.0.7-g52221d6fec)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.0.4 | 77 | 12/8/2024 |
3.0.3 | 110 | 10/31/2024 |
2.2.136 | 89 | 10/16/2024 |
2.2.125 | 116 | 10/2/2024 |
2.2.100 | 114 | 7/30/2024 |
2.2.86 | 1,599 | 6/24/2024 |
2.2.80 | 121 | 6/18/2024 |
2.2.67 | 113 | 5/19/2024 |
2.2.50 | 607 | 4/24/2024 |
2.2.39 | 153 | 4/6/2024 |
2.2.25 | 142 | 2/25/2024 |
2.2.10 | 954 | 2/4/2024 |
2.2.2 | 130 | 1/29/2024 |
2.1.45 | 315 | 1/7/2024 |
2.1.14 | 271 | 11/2/2023 |
2.1.9 | 135 | 10/31/2023 |
2.1.4 | 1,548 | 8/16/2023 |
2.0.4 | 395 | 8/6/2023 |
1.0.7 | 418 | 6/18/2023 |
1.0.7-g52221d6fec | 136 | 6/18/2023 |
1.0.3-g14999e94ed | 138 | 6/18/2023 |
1.0.1-g679cd8abba | 148 | 6/17/2023 |