Skip to content

Instantly share code, notes, and snippets.

@tgreensill
tgreensill / Startup.cs
Created April 3, 2020 09:53
AspNetCore Spa Service with Vue
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
@tgreensill
tgreensill / MappedKeyVaultSecretManager.cs
Last active June 26, 2023 16:08
KeyVaultSecretManager that uses a dictionary to map secrets from the key vault to appSettings.
/// <summary>
/// Custom KeyVaultSecretManager that uses a dictionary in the appsettings to map
/// keyvault secrets to appsettings. Useful for when seret names change between environments.
/// The key part of the dictionary should match the appSetting to override with the secret value.
/// The value part ofthe dictionary should be the name of the secret to pull the value from.
/// </summary>
public class MappedKeyVaultSecretManager : IKeyVaultSecretManager
{
private readonly IReadOnlyDictionary<string, string> _mappings;