Since the Environment Variable is set on your Application Pool level, you are able to read it from anywhere in your ASP.NET Core APP using Environment Class
(the default environment name is "Production" in your account)
For instance:
default code to read connection string from appsettings.json in Startup.cs
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
now, you can change it to this
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Environment.GetEnvironmentVariable("DefaultConnection")));
Another sample
using System;
...
var apiKey = Environment.GetEnvironmentVariable("apiKey");
Article ID: 2157, Created: May 1, 2021 at 5:01 AM, Modified: June 5, 2021 at 8:48 AM