I am learning about environment variables and how to use them on dev and in production on azure. So far I have some setting values in my appsettings.json
file within the values section. I want to get this setting out. I tried
string value = Environment.GetEnvironmentVariable("TestValue");
doesn't return anything.
Here are my settings:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"Values": {
"TestValue": "HelloWorld",
},
"AllowedHosts": "*"
}
I want to set the variable in my appsettings and then call getvariables
function to get them is that possible. The reason I want to do this is because I don't want to check in my appsettings.json
file on git, instead when I deploy to production, I want to add the settings myself manually on Azure using the variables.