![]() |
VOOZH | about |
dotnet add package AzureKeyVaultEmulator.Client --version 3.1.0
NuGet\Install-Package AzureKeyVaultEmulator.Client -Version 3.1.0
<PackageReference Include="AzureKeyVaultEmulator.Client" Version="3.1.0" />
<PackageVersion Include="AzureKeyVaultEmulator.Client" Version="3.1.0" />Directory.Packages.props
<PackageReference Include="AzureKeyVaultEmulator.Client" />Project file
paket add AzureKeyVaultEmulator.Client --version 3.1.0
#r "nuget: AzureKeyVaultEmulator.Client, 3.1.0"
#:package AzureKeyVaultEmulator.Client@3.1.0
#addin nuget:?package=AzureKeyVaultEmulator.Client&version=3.1.0Install as a Cake Addin
#tool nuget:?package=AzureKeyVaultEmulator.Client&version=3.1.0Install as a Cake Tool
This library simplifies the inclusion of the Azure Key Vault Emulator into your local development environment.
You do not need to use it but it makes life easier. Due to the constraints of Azure Key Vault and the associated client libraries, any requests that don't come from https://*.vault.azure.net are rejected.
To work around this you need to set DisableChallengeResourceVerification = true for each client. This library does that for you, emulates the authentication and then dependency injects the clients you need.
First install the package to your application that needs to use Key Vault:
dotnet add package AzureKeyVaultEmulator.Client
Next you'll need to reference the vaultUri which points at the docker container.
If you're using .NET Aspire this will appear in your appsettings.json:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"myAspireResourceName": "<connectionstring will be populated here>"
}
}
You don't need to add this into your appsettings.json beforehand, Aspire will do this for you.
If you're using the Emulator image directly through Docker your vault URI will be https://localhost:4997.
Including support for the emulator is simple:
// Injected by Aspire using the name "keyvault".
var vaultUri = builder.Configuration.GetConnectionString("keyvault") ?? string.Empty;
// Basic Secrets only implementation
builder.Services.AddAzureKeyVaultEmulator(vaultUri);
You can configure which Clients you want to expose like so:
builder.Services.AddAzureKeyVaultEmulator(vaultUri, secrets: true, keys: true, certificates: false);
By default only a SecretClient will be available, but you can easily add CertificateClient and KeyClient support.
Now you've got your clients set up you can simply use them like you would any other DI service:
private SecretClient _secretClient;
public SecretsController(SecretClient secretClient)
{
_secretClient = secretClient;
}
public async Task GetSecret(string name)
{
var secret = await _secretClient.GetSecretAsync(name);
}
To make life easy you can create an environment flag in your Program.cs to use the Emulator in a dev environment and the hosted Vault in production:
var vaultUri = builder.Configuration.GetConnectionString("keyvault") ?? string.Empty;
if(builder.Environment.IsDevelopment())
builder.Services.AddAzureKeyVaultEmulator(vaultUri, secrets: true, certificates: true, keys: true);
else
builder.Services.AddAzureClients(client =>
{
var asUri = new Uri(vaultUri);
client.AddSecretClient(asUri);
client.AddKeyClient(asUri);
client.AddCertificateClient(asUri);
});
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on AzureKeyVaultEmulator.Client:
| Package | Downloads |
|---|---|
|
Cogito.Azure.KeyVault
Additional components for managing Azure Key Vaults. |
Showing the top 1 popular GitHub repositories that depend on AzureKeyVaultEmulator.Client:
| Repository | Stars |
|---|---|
|
FritzAndFriends/TagzApp
An application that discovers content on social media for hashtags
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.1.0 | 5,775 | 5/16/2026 |
| 3.0.1 | 427 | 5/15/2026 |
| 3.0.0 | 3,943 | 5/9/2026 |
| 2.9.1 | 1,566 | 5/8/2026 |
| 2.9.0 | 29,756 | 3/23/2026 |
| 2.8.4 | 31,811 | 2/3/2026 |
| 2.8.3 | 8,124 | 1/22/2026 |
| 2.8.2 | 5,203 | 1/14/2026 |
| 2.8.1 | 394 | 1/13/2026 |
| 2.8.0 | 1,220 | 1/10/2026 |
| 2.7.8 | 30,142 | 12/21/2025 |
| 2.7.7 | 1,065 | 12/16/2025 |
| 2.7.6 | 384 | 12/15/2025 |
| 2.7.5 | 5,854 | 12/6/2025 |
| 2.7.4 | 1,140 | 12/4/2025 |
| 2.7.3 | 5,606 | 11/20/2025 |
| 2.7.2 | 513 | 11/19/2025 |
| 2.7.1 | 790 | 11/19/2025 |
| 2.7.0 | 4,300 | 11/5/2025 |
| 2.6.6 | 12,516 | 10/16/2025 |