Blitz.Configuration.Vault.Library 6.1.0

dotnet add package Blitz.Configuration.Vault.Library --version 6.1.0
NuGet\Install-Package Blitz.Configuration.Vault.Library -Version 6.1.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="Blitz.Configuration.Vault.Library" Version="6.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blitz.Configuration.Vault.Library --version 6.1.0
#r "nuget: Blitz.Configuration.Vault.Library, 6.1.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.
// Install Blitz.Configuration.Vault.Library as a Cake Addin
#addin nuget:?package=Blitz.Configuration.Vault.Library&version=6.1.0

// Install Blitz.Configuration.Vault.Library as a Cake Tool
#tool nuget:?package=Blitz.Configuration.Vault.Library&version=6.1.0

VaultAsConfigDemo

Using Hashicorp Vault as a Configuration Store

Prerequisites

  1. Install Docker: https://docs.docker.com/get-docker/

  2. Install Vault Client: https://www.vaultproject.io/downloads

  3. Start Docker

  4. Run ./scripts/start_docker_vault.sh (or PS1) to start Vault in Docker, which will tie up the command bash shell

  5. Check to make sure it started ok ./scripts/vault-status.sh (or PS1)

  6. Put some values into the Vault by running ./scripts/put-settings.sh (or PS1) which puts the json file into the vault under myApp/dev using the file myApp-dev-settings.json

  7. Run the demo in Visual Studio or Code to see how it works

  8. Stop Docker Vault ./scripts/start_docker_vault.sh (or PS1)

Setting up a structure for key value pairs or json blobs

  1. Decide on a folder structure, for the demo we're using a subpath of:

    /{application}/{environment}

Under the RootPath of RootPath, so in the Hasicorp Parlance, the Store is secret/${VAULT_APP}/${VAULT_ENV}, which the API would need the path /v1/secret/data/${VAULT_APP}/${VAULT_ENV}

  1. Decide on loose key/value pairs or a json datagram.

    • For this demo we have selected json (as we think is is tidy).
  2. Store the configuration using code or the vault cli

    • See the example scripts

Logging into UI

Login to UI

Command Line

$ ./Blitz.Configuration.Vault.Demo --help
Blitz.Configuration.Vault.Demo 1.0.0 Copyright (C) 2020 Blitz.Configuration.Vault.Demo
Blitz.Configuration.Vault.Demo 1.0.0
Copyright (C) 2020-2023 Blitz.Configuration.Vault.Demo
USAGE:
From Environment Variables:
  VaultDemo
Vary Environment:
  VaultDemo --App myApp --Env dev --Token myroot
Full command line:
  VaultDemo --App myApp --Dump --Env dev --Root Path v1/secret/data --Token
  myroot --VaultUrl http://localhost:8200

  -u, --VaultUrl     Vault Url (env: 'vaulturl')

  -t, --Token        Vault Token (env: 'vaulttoken')

  -a, --App          Application Name (env: 'vaultapp')

  -e, --Env          Environment (env: 'vaultenv')

  -d, --Dump         Dump All Read Configuration

  -r, --Root Path    (Default: v1/secret/data) RootPath e.g. 'v1/secret/data'
                     (env: 'vaultrootpath')

  --help             Display this help screen.

  --version          Display version information.

Configuration Variables

These can be environment variables (ideally injected as part of CD pipeline)

variable description default
vaulturl url to vault server http://127.0.0.1:8200
vaulttoken root token myroot
vaultapp your applicaton name myApp
vaultenv which environment are you running in dev
vaultrootpath relative path to the root of your secrets v1/secret/data

Demo Data

  1. The script scripts\put-settings.ps1 creates 3 key/value pairs using in the vaultapp = myApp, for the vaultenv of dev
  2. The command line, and web demos use these values to get the configuration for themselves
    1. This will need to be refactored to your use case
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
6.1.0 163 4/23/2023

- 6.1.0 - Updated to Current Packages