New console template – use user secret

  1. dotnet user-secrets init
  2. set a secret: dotnet user-secrets set “API_KEY” “test123”
  3. use UserSecretsId (from .csproj file) in AddUserSecrets()

IConfiguration configuration = new ConfigurationBuilder()

var key = configuration["API_KEY"];

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: