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.
Loading...
Related Quiz
- In ASP.NET Core, the _________ directory is conventionally used to store static files.
- You're building a custom registration form for an ASP.NET Core application, and you want to ensure that users provide a strong password. Which configuration in ASP.NET Core Identity should you adjust?
- You're new to ASP.NET Core and hear about Entity Framework Core. What is the main purpose of using Entity Framework Core in web applications?
- If a developer is looking to quickly scaffold a new ASP.NET Core controller, which CLI command would they most likely use?
- Using the {id:int} syntax in an attribute route enforces that the id parameter must be of type ______.