Usually in spring boot application I set to read the connection string or any similar value from environment variable as below. At the time of application startup, the values will be set and application can read if from application.properties file.
spring.datasource.url=${DB_URL}
Do we have similar option achieve the same in appsettings.json file in .Net Core application? When I start the application, the DB connection and log level to set from the values available in environment variables.
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"UATDB": "Server=localhost;Database=UAT;User ID=admin;Password=E123456;Trusted_Connection=false;TrustServerCertificate=True;Integrated Security=False;"
}