Workleap.Extensions.Configuration.Secrets 1.0.5-preview.18

Prefix Reserved
This is a prerelease version of Workleap.Extensions.Configuration.Secrets.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Workleap.Extensions.Configuration.Secrets --version 1.0.5-preview.18                
NuGet\Install-Package Workleap.Extensions.Configuration.Secrets -Version 1.0.5-preview.18                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Workleap.Extensions.Configuration.Secrets" Version="1.0.5-preview.18" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Workleap.Extensions.Configuration.Secrets --version 1.0.5-preview.18                
#r "nuget: Workleap.Extensions.Configuration.Secrets, 1.0.5-preview.18"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Workleap.Extensions.Configuration.Secrets as a Cake Addin
#addin nuget:?package=Workleap.Extensions.Configuration.Secrets&version=1.0.5-preview.18&prerelease

// Install Workleap.Extensions.Configuration.Secrets as a Cake Tool
#tool nuget:?package=Workleap.Extensions.Configuration.Secrets&version=1.0.5-preview.18&prerelease                

Workleap.Extensions.Configuration.Secrets

nuget build

This package allows storing configuration values in Azure Key Vault Secrets, using the right Azure credentials based on the current environment.

It can also be used to register ITokenCredentialProvider and ISecretClientProvider in IServiceCollection in order to access Azure credentials or a SecretClient instance.

Getting started

dotnet add package Workleap.Extensions.Configuration.Secrets

Example with an ASP.NET Core minimal API:

var builder = WebApplication.CreateBuilder();

// There are three ways to load configuration values from Azure Key Vault:
builder.Configuration.AddKeyVaultSecrets(builder.Environment);
builder.Configuration.AddKeyVaultSecrets(builder.Environment, new Uri("<my-key-vault-url>"));
builder.Configuration.AddKeyVaultSecrets(builder.Environment, "<my-configuration-key>");

// Register ITokenCredentialProvider and ISecretClientProvider services (optional)
builder.Services.AddKeyVaultSecrets();

Using the registered services

ITokenCredentialProvider and its public implementation TokenCredentialProvider provides an instance of TokenCredential based on the current environment:

  • ManagedIdentityCredential on a non-development environment,
  • Chained credentials of AzureCliCredential and ManagedIdentityCredential in development environment, or
  • CachedInteractiveBrowserCredential in development environment only when Fiddler is opened (Fiddler interferes with az login authentication).
var azureCredential = new TokenCredentialProvider(environment).GetTokenCredential(); // or
var azureCredential = services.GetRequiredService<ITokenCredentialProvider>().GetTokenCredential();

ISecretClientProvider and its public implementation SecretClientProvider provides an instance of SecretClient based on the current environment:

var secretClientProvider = new SecretClientProvider(configurationBuilder, environment); // or
var secretClientProvider = new SecretClientProvider(configuration, environment); // or
var secretClientProvider = services.GetRequiredService<ISecretClientProvider>();
var secretClient = secretClientProvider.GetSecretClient(keyVaultKind); // or
var secretClient = secretClientProvider.GetSecretClient(keyVaultUri); // or
var secretClient = secretClientProvider.GetSecretClient(configurationKey);

License

Copyright © 2022, Workleap. This code is licensed under the Apache License, Version 2.0. You may obtain a copy of this license at https://github.com/gsoft-inc/gsoft-license/blob/master/LICENSE.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.5-preview.25 0 11/29/2024
1.0.5-preview.24 35 11/24/2024
1.0.5-preview.23 41 11/16/2024
1.0.5-preview.22 41 11/1/2024
1.0.5-preview.21 43 10/31/2024
1.0.5-preview.20 40 10/30/2024
1.0.5-preview.19 43 10/28/2024
1.0.5-preview.18 36 10/28/2024
1.0.5-preview.17 39 10/28/2024
1.0.5-preview.16 43 10/7/2024
1.0.5-preview.15 41 10/7/2024
1.0.5-preview.14 48 10/1/2024
1.0.5-preview.13 44 9/30/2024
1.0.5-preview.12 61 9/27/2024
1.0.5-preview.11 38 9/20/2024
1.0.5-preview.10 53 9/13/2024
1.0.5-preview.9 51 8/27/2024
1.0.5-preview.8 44 8/27/2024
1.0.5-preview.7 43 8/27/2024
1.0.5-preview.6 46 8/27/2024
1.0.5-preview.5 67 8/16/2024
1.0.5-preview.4 51 8/1/2024
1.0.5-preview.3 50 7/15/2024
1.0.5-preview.2 45 7/15/2024
1.0.5-preview.1 41 7/5/2024
1.0.4 3,946 6/25/2024
1.0.4-preview.4 52 6/25/2024
1.0.4-preview.3 51 6/14/2024
1.0.4-preview.2 61 5/31/2024
1.0.4-preview.1 58 5/31/2024
1.0.3 389 5/21/2024
1.0.3-preview.6 56 5/21/2024
1.0.3-preview.5 50 5/21/2024
1.0.3-preview.4 64 5/10/2024
1.0.3-preview.3 51 5/3/2024
1.0.3-preview.2 61 4/22/2024
1.0.3-preview.1 58 4/15/2024
1.0.2 2,694 4/12/2024
1.0.2-preview.33 60 4/12/2024
1.0.2-preview.32 64 4/3/2024
1.0.2-preview.31 53 4/3/2024
1.0.2-preview.30 58 3/8/2024
1.0.2-preview.29 57 3/7/2024
1.0.2-preview.28 66 3/4/2024
1.0.2-preview.27 65 3/1/2024
1.0.2-preview.26 62 2/16/2024
1.0.2-preview.25 64 2/12/2024
1.0.2-preview.24 65 2/6/2024
1.0.2-preview.23 64 2/6/2024
1.0.2-preview.22 60 1/22/2024
1.0.2-preview.21 62 1/12/2024
1.0.2-preview.20 55 1/12/2024
1.0.2-preview.19 58 1/12/2024
1.0.2-preview.18 75 12/18/2023
1.0.2-preview.17 94 11/26/2023
1.0.2-preview.16 75 11/17/2023
1.0.2-preview.15 63 11/17/2023
1.0.2-preview.14 67 11/13/2023
1.0.2-preview.13 75 11/6/2023
1.0.2-preview.12 73 10/30/2023
1.0.2-preview.11 89 10/24/2023
1.0.2-preview.10 77 10/20/2023
1.0.2-preview.9 81 10/17/2023
1.0.2-preview.8 81 10/13/2023
1.0.2-preview.7 75 10/13/2023
1.0.2-preview.6 79 9/26/2023
1.0.2-preview.5 80 9/25/2023
1.0.2-preview.4 67 9/21/2023
1.0.2-preview.3 70 9/20/2023
1.0.2-preview.2 73 9/20/2023
1.0.2-preview.1 74 9/20/2023
1.0.1 13,967 7/20/2023
1.0.1-preview.18 90 7/20/2023