You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for environment variables for configuration #2480
As far as I can see there is no way to use environment variables to override the appsettings.json for the downstream API.
The file src/Microsoft.Identity.Web.TokenAcquisition/TokenAcquirerFactory.cs has the following method:
privateIConfigurationReadConfiguration(){if(Configuration==null){// Read the configuration from a filevarbuilder=newConfigurationBuilder();stringbasePath=DefineConfiguration(builder);builder.SetBasePath(basePath).AddJsonFile("appsettings.json",optional:true);Configuration=builder.Build();}returnConfiguration;}
Changing it to:
privateIConfigurationReadConfiguration(){if(Configuration==null){// Read the configuration from a filevarbuilder=newConfigurationBuilder();stringbasePath=DefineConfiguration(builder);builder.SetBasePath(basePath).AddJsonFile("appsettings.json",optional:true).AddEnvironmentVariables();Configuration=builder.Build();}returnConfiguration;}
would provide better flexibility.
Alternatively a way to pass in the configuration to be used would also work.
Activity
jmprieur commentedon Sep 27, 2023
Thanks markjritchie
Would you like to propose a PR?
markjritchie commentedon Sep 27, 2023
Happy to, but thought I should check that I wasn't missing something
markjritchie commentedon Sep 27, 2023
Is there a guide on setting up the necessary PAT to push to a branch and create the PR?
I get authentication failed when I try to push the branch
jmprieur commentedon Sep 27, 2023
No. there is no PAT. You would have to fork the repo.
Fix build on .NET FW after #2480
Fix build on .NET FW after #2480 (#2488)
Fix #2456 (#2489)