-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Add support for Microsoft.Extensions.Configuration #53527
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
base: main
Are you sure you want to change the base?
Conversation
sdk/core/System.ClientModel/src/Convenience/ConfigurationManagerExtensions.cs
Show resolved
Hide resolved
sdk/core/System.ClientModel/src/Convenience/ConfigurationManagerExtensions.cs
Show resolved
Hide resolved
sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredentialOptions.cs
Show resolved
Hide resolved
sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredentialOptions.cs
Outdated
Show resolved
Hide resolved
sdk/resourcemanager/Azure.ResourceManager/src/ClientConnectionExtensions.cs
Show resolved
Hide resolved
sdk/core/System.ClientModel/src/Convenience/ConfigurationManagerExtensions.cs
Outdated
Show resolved
Hide resolved
API Change CheckAPIView identified API level changes in this PR and created the following API reviews Azure.Core |
| } | ||
| public static partial class ConfigurationManagerExtensions | ||
| { | ||
| public static System.ClientModel.Primitives.ClientConnection GetConnection(this Microsoft.Extensions.Configuration.IConfigurationManager configuration, string sectionName) { throw null; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since these apis are in SCM, should these be just static Create methods on ClientConnection, or maybe even ClientConnection ctor? This way we don't need to add a new type (the config extensions)
| /// <param name="configuration"></param> | ||
| /// <param name="sectionName"></param> | ||
| /// <returns></returns> | ||
| public static ClientConnection GetConnection(this IConfigurationManager configuration, string sectionName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we dont need an optional parameter called "format" (or something like that). This would allow us to add support for all the combinations in aspire. Unless we are fine with probing all the formats.
| /// <param name="configuration"></param> | ||
| /// <param name="sectionName"></param> | ||
| /// <returns></returns> | ||
| public static ClientConnection GetAzureConnection(this IConfigurationManager configuration, string sectionName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should not give it a nice name: GetClientConnection. This method will work with both Azure and non-Azure scenarios. I even wonder if we could call the SCM variant of the method the same and use the new C# attribute (overload priority) to resolve ambiguity
Initial prototype to support Microsoft.Extensions.Configuration and Microsoft.Extensions.DependencyInjection
Sample usage with configuration only
Sample usage with dependency injection