AzureKeyVaultEmulator.Aspire.Hosting
3.1.0
dotnet add package AzureKeyVaultEmulator.Aspire.Hosting --version 3.1.0
NuGet\Install-Package AzureKeyVaultEmulator.Aspire.Hosting -Version 3.1.0
<PackageReference Include="AzureKeyVaultEmulator.Aspire.Hosting" Version="3.1.0" />
<PackageVersion Include="AzureKeyVaultEmulator.Aspire.Hosting" Version="3.1.0" />
<PackageReference Include="AzureKeyVaultEmulator.Aspire.Hosting" />
paket add AzureKeyVaultEmulator.Aspire.Hosting --version 3.1.0
#r "nuget: AzureKeyVaultEmulator.Aspire.Hosting, 3.1.0"
#:package AzureKeyVaultEmulator.Aspire.Hosting@3.1.0
#addin nuget:?package=AzureKeyVaultEmulator.Aspire.Hosting&version=3.1.0
#tool nuget:?package=AzureKeyVaultEmulator.Aspire.Hosting&version=3.1.0
Overview
Provides the ability to emulate the AzureKeyVault Aspire resource using the open source emulator.
Recommended, but not required, is the client library to make using the emulator in your applications incredibly simple.
Usage
Install the package to your .NET Aspire AppHost project:
dotnet add package AzureKeyVaultEmulator.Aspire.Hosting
Next you can either redirect an existing AzureKeyVaultResource to use the emulator, or directly include it without needing any Azure configuration.
To redirect an existing resource:
var keyVaultServiceName = "keyvault";
var keyVault = builder
.AddAzureKeyVault(keyVaultServiceName)
.RunAsEmulator(); // Add this line
var webApi = builder
.AddProject<Projects.MyApi>("api")
.WithReference(keyvault); // reference as normal
To use directly without needing to set up any Azure configuration:
var keyVaultServiceName = "keyvault";
var keyVault = builder.AddAzureKeyVaultEmulator(keyVaultServiceName);
You will then have a feature complete, emulated Azure Key Vault running locally:

Using DefaultAzureCredential
If your consumer authenticates with Azure.Identity.DefaultAzureCredential (so it doesn't need
to depend on the emulator-specific client library),
add WithAzureKeyVaultEmulatorCredentials in the AppHost. Everything is wired up automatically —
credentials, tenant, and authority all flow into the consumer for you (the host machine's
AZURE_TENANT_ID is picked up automatically when set):
// AppHost
var keyVault = builder.AddAzureKeyVaultEmulator("keyvault");
builder.AddProject<Projects.MyApi>("api")
.WithAzureKeyVaultEmulatorCredentials(keyVault)
.WithReference(keyVault);
The only consumer-side settings the SDK still requires are DisableInstanceDiscovery = true and
DisableChallengeResourceVerification = true (the emulator runs on localhost rather than
*.vault.azure.net):
var credential = new DefaultAzureCredential(new DefaultAzureCredentialOptions
{
DisableInstanceDiscovery = true,
});
builder.Services.AddSingleton(_ => new SecretClient(
new Uri(vaultUri),
credential,
new SecretClientOptions { DisableChallengeResourceVerification = true }));
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Aspire.Hosting.AppHost (>= 13.3.0)
- Aspire.Hosting.Azure.KeyVault (>= 13.3.0)
- Azure.Security.KeyVault.Certificates (>= 4.8.0)
- Azure.Security.KeyVault.Keys (>= 4.10.0)
-
net8.0
- Aspire.Hosting.AppHost (>= 13.3.0)
- Aspire.Hosting.Azure.KeyVault (>= 13.3.0)
- Azure.Security.KeyVault.Certificates (>= 4.8.0)
- Azure.Security.KeyVault.Keys (>= 4.10.0)
-
net9.0
- Aspire.Hosting.AppHost (>= 13.3.0)
- Aspire.Hosting.Azure.KeyVault (>= 13.3.0)
- Azure.Security.KeyVault.Certificates (>= 4.8.0)
- Azure.Security.KeyVault.Keys (>= 4.10.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on AzureKeyVaultEmulator.Aspire.Hosting:
| Repository | Stars |
|---|---|
|
FritzAndFriends/TagzApp
An application that discovers content on social media for hashtags
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 3.1.0 | 40 | 5/16/2026 | |
| 3.0.1 | 72 | 5/15/2026 | |
| 3.0.0 | 1,052 | 5/9/2026 | |
| 2.9.1 | 750 | 5/8/2026 | |
| 2.9.0 | 20,991 | 3/23/2026 | |
| 2.8.4 | 23,399 | 2/3/2026 | |
| 2.8.3 | 4,229 | 1/22/2026 | |
| 2.8.2 | 6,691 | 1/14/2026 | |
| 2.8.1 | 261 | 1/13/2026 | |
| 2.8.0 | 2,305 | 1/10/2026 | |
| 2.7.8 | 12,682 | 12/21/2025 | |
| 2.7.7 | 1,122 | 12/16/2025 | |
| 2.7.6 | 532 | 12/15/2025 | |
| 2.7.5 | 4,777 | 12/6/2025 | |
| 2.7.4 | 839 | 12/4/2025 | |
| 2.7.3 | 3,329 | 11/20/2025 | |
| 2.7.2 | 500 | 11/19/2025 | |
| 2.7.1 | 777 | 11/19/2025 | |
| 2.7.0 | 11,182 | 11/5/2025 | |
| 2.6.6 | 8,364 | 10/16/2025 |