AzureKeyVaultEmulator.Aspire.Hosting
3.1.5
dotnet add package AzureKeyVaultEmulator.Aspire.Hosting --version 3.1.5
NuGet\Install-Package AzureKeyVaultEmulator.Aspire.Hosting -Version 3.1.5
<PackageReference Include="AzureKeyVaultEmulator.Aspire.Hosting" Version="3.1.5" />
<PackageVersion Include="AzureKeyVaultEmulator.Aspire.Hosting" Version="3.1.5" />
<PackageReference Include="AzureKeyVaultEmulator.Aspire.Hosting" />
paket add AzureKeyVaultEmulator.Aspire.Hosting --version 3.1.5
#r "nuget: AzureKeyVaultEmulator.Aspire.Hosting, 3.1.5"
#:package AzureKeyVaultEmulator.Aspire.Hosting@3.1.5
#addin nuget:?package=AzureKeyVaultEmulator.Aspire.Hosting&version=3.1.5
#tool nuget:?package=AzureKeyVaultEmulator.Aspire.Hosting&version=3.1.5
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:

TypeScript AppHosts
Add AzureKeyVaultEmulator.Aspire.Hosting to your TypeScript AppHost's integration
packages and run aspire restore to generate the bindings.
To use the emulator directly:
import { createBuilder } from './.aspire/modules/aspire.mjs';
const builder = await createBuilder();
const keyVault = await builder.addAzureKeyVaultEmulator('keyvault', {
port: 4997,
persist: true,
});
await builder.build().run();
To redirect an existing Azure Key Vault resource:
const keyVault = await builder.addAzureKeyVault('keyvault').runAsEmulator({
options: { port: 4997, persist: true },
});
Both methods can be called without options. runAsEmulator also accepts
configSectionName alongside options. Omitting the options object retains
configuration-section lookup; supplying it uses the existing C# defaults for
omitted fields. Certificate setup and validation are unchanged, including the
requirement for a fixed port when persist is enabled. Otherwise, port is
optional; omitting it lets Aspire assign a random host port.
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.5.0)
- Aspire.Hosting.Azure.KeyVault (>= 13.5.0)
- Azure.Core (>= 1.61.0)
- Azure.Identity (>= 1.21.0)
- Azure.Security.KeyVault.Certificates (>= 4.9.0)
- Azure.Security.KeyVault.Keys (>= 4.10.0)
- Azure.Security.KeyVault.Secrets (>= 4.11.0)
- AzureKeyVaultEmulator.Client (>= 3.1.5)
- MessagePack (>= 2.5.303)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.11)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Extensions.Hosting (>= 1.17.0)
-
net8.0
- Aspire.Hosting.AppHost (>= 13.5.0)
- Aspire.Hosting.Azure.KeyVault (>= 13.5.0)
- Azure.Core (>= 1.61.0)
- Azure.Identity (>= 1.21.0)
- Azure.Security.KeyVault.Certificates (>= 4.9.0)
- Azure.Security.KeyVault.Keys (>= 4.10.0)
- Azure.Security.KeyVault.Secrets (>= 4.11.0)
- AzureKeyVaultEmulator.Client (>= 3.1.5)
- MessagePack (>= 2.5.303)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.11)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Extensions.Hosting (>= 1.17.0)
-
net9.0
- Aspire.Hosting.AppHost (>= 13.5.0)
- Aspire.Hosting.Azure.KeyVault (>= 13.5.0)
- Azure.Core (>= 1.61.0)
- Azure.Identity (>= 1.21.0)
- Azure.Security.KeyVault.Certificates (>= 4.9.0)
- Azure.Security.KeyVault.Keys (>= 4.10.0)
- Azure.Security.KeyVault.Secrets (>= 4.11.0)
- AzureKeyVaultEmulator.Client (>= 3.1.5)
- MessagePack (>= 2.5.303)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.11)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Extensions.Hosting (>= 1.17.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.5 | 1,370 | 10/20/2026 | |
| 3.1.4 | 2,863 | 10/14/2026 | |
| 3.1.3 | 45,072 | 8/7/2026 | |
| 3.1.2 | 5,375 | 8/4/2026 | |
| 3.1.1 | 2,056 | 8/2/2026 | |
| 3.1.0 | 51,792 | 5/16/2026 | |
| 3.0.1 | 3,021 | 5/15/2026 | |
| 3.0.0 | 9,500 | 5/9/2026 | |
| 2.9.1 | 3,085 | 5/8/2026 | |
| 2.9.0 | 61,314 | 3/23/2026 | |
| 2.8.4 | 41,088 | 2/3/2026 | |
| 2.8.3 | 5,644 | 1/22/2026 | |
| 2.8.2 | 12,742 | 1/14/2026 | |
| 2.8.1 | 293 | 1/13/2026 | |
| 2.8.0 | 2,836 | 1/10/2026 | |
| 2.7.8 | 17,870 | 12/21/2025 | |
| 2.7.7 | 1,155 | 12/16/2025 | |
| 2.7.6 | 563 | 12/15/2025 | |
| 2.7.5 | 5,683 | 12/6/2025 | |
| 2.7.4 | 882 | 12/4/2025 |