Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Create more robustness in configuration #15

Open
MCKRUZ opened this issue Dec 19, 2024 · 5 comments
Open

Feature Request: Create more robustness in configuration #15

MCKRUZ opened this issue Dec 19, 2024 · 5 comments

Comments

@MCKRUZ
Copy link

MCKRUZ commented Dec 19, 2024

Currently when trying to use libraries like MSAL and other parts of the Agents framework it requires us to setup our appsettings.json a certain way with certain settings.

One example of where this is done is when calling the "AddDefaultMsalAuth" method where you have to send in a configuration section for "MSALConfiguration".

Most of my enterprise level applications have custom configuration code where we inject various configurations from different locations and variations. Rather then have the libraries pull directly from configuration could we possibly have an option to send in the variables directly? I find myself having to write code to dynamically create configuration sections on the fly to do translations to just use the libraries.

@tracyboehrer
Copy link
Member

@MCKRUZ MSALConfiguration in optional. But what you want is a way to set those programmatically instead of via config?

@tracyboehrer tracyboehrer transferred this issue from microsoft/Agents Dec 19, 2024
@MCKRUZ
Copy link
Author

MCKRUZ commented Dec 20, 2024

Correct. It's not only in the MSALConfiguration though it's all over the Agent framework. For example I had to create my own version of the ConfigurationConnections class in order to make it so I didn't have to setup my appsettings.json in a certain manner. That class takes in a IConfiguration object which directly pulls from the appsettings. I try whenever possible to not recreate code that Microsoft has already built since then I have to watch for any changes you guys make and then make the appropriate changes on my side. It would just make life easier if it were more robust to handle configuration outside of appsettings.json.

@tracyboehrer
Copy link
Member

@MCKRUZ How did you handle IConnections? Though that is why that is an interface, and different implementations could be created.

@tracyboehrer
Copy link
Member

@MCKRUZ It would be interesting to see some examples. It would be more accurate to say it is currently IConfiguration based, which may be things other than appsettings. A programmatic way seems reasonable for many cases, and as we move on from "preview" status we'd like to support more flexible means.

@MCKRUZ
Copy link
Author

MCKRUZ commented Jan 1, 2025

So I ended up creating my own version of the IConnections class. In my project I have a POCO object called AppConfig that handles our rather large config. So to circumvent all of the places where you guys utilized IConfiguration, I simply created a helper class that loads the configs into memory and spits out a IConfigurationSection object whenever I need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants