In a project review, you noticed that the production database connection string is exposed in appsettings.json. How should you securely manage this connection string in an ASP.NET Core application?

  • Use User Secrets
  • Encrypt the appsettings.json file
  • Store it in an environment variable
  • Use a configuration file in the project root
In an ASP.NET Core application, it's not secure to expose sensitive information like a production database connection string in appsettings.json. To securely manage it, you should store it in an environment variable. This approach helps protect sensitive data from accidental exposure and is a best practice for configuration management in production environments.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *