Ask Your Question
3

What is the process for releasing appsettings specific to certain environments in a .Net core application?

asked 2021-06-06 11:00:00 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-11-29 14:00:00 +0000

bukephalos gravatar image

The process for releasing appsettings specific to certain environments in a .Net core application involves the following steps:

  1. Create separate appsettings files for each environment (e.g. appsettings.development.json, appsettings.production.json).
  2. Configure the app to load the appropriate appsettings file for the current environment using the environment variable ASPNETCORE_ENVIRONMENT.
  3. In the development environment, add a user secrets configuration file (secrets.json) to store sensitive data (e.g. database connection strings) that should not be checked into source control.
  4. Configure the app to use the user secrets configuration file in the development environment.
  5. Avoid hardcoding sensitive data in the appsettings files.
  6. Use environment variables to store configuration data that varies between environments (e.g. URLs, API keys).
  7. Use a configuration provider like Azure Key Vault to securely store and manage sensitive configuration data in production.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-06-06 11:00:00 +0000

Seen: 10 times

Last updated: Nov 29 '21