I have a .NET 6 Web API application and I have define one key in "appsettings.json" file in a below way,
{
"UID": "myUid"
}
Now I want to read the "UID" key like as environment variable like,
var x = Environment.GetEnvironmentVariable("UID");
It's give me "null" result. What fix is required here?
I know I can put the key in launsettings.json
and it will work, but I want to put only in appsettings.