I am currently trying to design a service that serves as a central place for configuration. However, I noticed there are quite a few services in ConfigurationServices in Startup.cs that use various settings from appsettings.json:
For example:
services.AddDbContext<MyContext>(optionsAction: options =>
{
options.UseSqlServer(Configuration.GetConnectionString(name: "somekey"));
});
I know if I go into the docker container of a .net core web app and manually change something in appsettings.json with nano and restart the service, it acknowledges the new configuration and uses it. The same with environment variables.
However, I am trying to determine if possible if there was a way to update/modify appsettings.json dynamically and get the services in in ConfigurationServices in Startup.cs to acknowledge the changes without actually restarting the service.
Any help would be much appreciated.