AzureKeyVaultEmulator.Aspire.Hosting
2.0.0
dotnet add package AzureKeyVaultEmulator.Aspire.Hosting --version 2.0.0
NuGet\Install-Package AzureKeyVaultEmulator.Aspire.Hosting -Version 2.0.0
<PackageReference Include="AzureKeyVaultEmulator.Aspire.Hosting" Version="2.0.0" />
<PackageVersion Include="AzureKeyVaultEmulator.Aspire.Hosting" Version="2.0.0" />
<PackageReference Include="AzureKeyVaultEmulator.Aspire.Hosting" />
paket add AzureKeyVaultEmulator.Aspire.Hosting --version 2.0.0
#r "nuget: AzureKeyVaultEmulator.Aspire.Hosting, 2.0.0"
#addin nuget:?package=AzureKeyVaultEmulator.Aspire.Hosting&version=2.0.0
#tool nuget:?package=AzureKeyVaultEmulator.Aspire.Hosting&version=2.0.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
[!WARNING] This will still attempt to provision resources (or confirm they already exist), at runtime your connection string will be a
localhost
URL. <br /><br /> When using the emulator no requests will be made to/from the hosted resource. This will start an empty key vault in a container.
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:
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net9.0
- Aspire.Hosting.AppHost (>= 9.2.0)
- Aspire.Hosting.Azure.KeyVault (>= 9.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.