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
                    
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="AzureKeyVaultEmulator.Aspire.Hosting" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AzureKeyVaultEmulator.Aspire.Hosting" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="AzureKeyVaultEmulator.Aspire.Hosting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AzureKeyVaultEmulator.Aspire.Hosting --version 2.0.0
                    
#r "nuget: AzureKeyVaultEmulator.Aspire.Hosting, 2.0.0"
                    
#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.
#addin nuget:?package=AzureKeyVaultEmulator.Aspire.Hosting&version=2.0.0
                    
Install AzureKeyVaultEmulator.Aspire.Hosting as a Cake Addin
#tool nuget:?package=AzureKeyVaultEmulator.Aspire.Hosting&version=2.0.0
                    
Install AzureKeyVaultEmulator.Aspire.Hosting as a Cake Tool

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:

Azure Key Vault Emulator in .NET Aspire

Product 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. 
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
2.0.0 45 a day ago
1.1.0 187 7 days ago
1.0.7 118 11 days ago
1.0.6 142 a month ago
1.0.5 448 a month ago
1.0.4 266 a month ago
1.0.0 258 a month ago