I have an ASP.Net 5 application where I have some configuration values ββstored in config.json file. My config.json file looks something like this.
{ "AppSettings": { "SiteEmailAddress": "some@email.com", "APIKey": "some_api_key" } }
I am setting up a config.json file for use in a Startup.cs file like this.
public static IConfigurationRoot Configuration; public Startup(IApplicationEnvironment appEnv) { var builder = new ConfigurationBuilder(appEnv.ApplicationBasePath) .AddJsonFile("config.json") .AddEnvironmentVariables(); Configuration = builder.Build(); }
And access to configuration settings like this.
var email = Startup.Configuration["AppSettings:SiteEmailAddress"];
Earlier in ASP.Net, we could use the Web.Config file to store these application settings and override them in the application settings in the "Azure Application Settings" section, and this fixes any problems. But how can I do the same in an ASP.Net 5 application.
How to override configuration values ββin config.json file in the "Application Settings" section in Azure.
Kasun Kodagoda
source share