The Doppler.Extensions.Configuration
package allows storing configuration values using Doppler Secrets.
Install the package with Nuget:
dotnet add package Doppler.Extensions.Configuration
You need a Doppler account to use this package.
To load initialize configuration from Doppler secrets call the AddDoppler
on ConfigurationBuilder
:
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.AddDoppler(builder.Configuration.GetValue<string>("Doppler:ServiceToken"))
IConfiguration configuration = builder.Build();
Console.WriteLine(configuration["MySecret"]);