Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2ea9632
Give the users the ability to have control over ConfigurationClient i…
samsadsam Oct 25, 2024
e0a910b
add IsAzureAppConfigurationSource extension (#608)
samsadsam Oct 25, 2024
7528888
update a comment to reflect that `ArgumentException` is not suppresse…
samsadsam Oct 28, 2024
f7ec121
check etag on 200 for sentinel key (#607)
samsadsam Oct 28, 2024
6fc0f9a
Fix regressed unit tests (#610)
samsadsam Nov 5, 2024
90835cf
ensure failed exit codes are returned to ci.yml (#609)
amerjusupovic Nov 5, 2024
a544fd0
Remove variant config ref (#614)
zhiyuanliang-ms Dec 16, 2024
40768ff
Include discovered replicas in replica count for request tracing (#613)
amerjusupovic Jan 3, 2025
5e6a012
Add `RegisterAll` API to enable monitoring collections of key-values …
amerjusupovic Jan 22, 2025
47165a6
Revert "Give the users the ability to have control over Configuration…
amerjusupovic Feb 6, 2025
c740e7c
Add `RegisterAll` API to enable monitoring collections of key-values …
amerjusupovic Jan 22, 2025
6dc9ae2
Give the users the ability to have control over ConfigurationClient i…
amerjusupovic Feb 6, 2025
4dd994f
Merge pull request #619 from Azure/refactor-preview-to-main
amerjusupovic Feb 12, 2025
662250e
update packages to 8.1.0 (#621)
amerjusupovic Feb 13, 2025
7dc547c
Bugfix for collection monitoring etag logic (#623)
amerjusupovic Feb 19, 2025
ab01890
Add request tracing for push refresh usage (#626)
amerjusupovic Feb 24, 2025
6ec290e
Fix bug with feature flag and key-value select ordering (#629)
amerjusupovic Feb 26, 2025
961cdeb
update packages to 8.1.1 (#630)
amerjusupovic Feb 26, 2025
6da33d2
merge with conflicts
samsadsam Mar 12, 2025
4ab2dda
fix merge conflict errors
samsadsam Mar 12, 2025
c1cdea3
Ensure kv collection refresh settings are not considered unless the f…
jimmyca15 Mar 12, 2025
d5dc83d
Merge branch 'main' into user/samisadfa/merge-main-to-preview
samsadsam Mar 18, 2025
c2e3558
revert versions
samsadsam Mar 18, 2025
87f0f85
Shorten the defeult timeout of individual call to backend (#620)
RichardChen820 Mar 18, 2025
258452d
merge with main
samsadsam Mar 18, 2025
573320e
Merge pull request #636 from Azure/user/samisadfa/merge-main-to-preview
samsadsam Mar 18, 2025
d7f5939
upgrade to 8.2.0-preview (#638)
samsadsam Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<!-- Nuget Package Version Settings -->

<PropertyGroup>
<OfficialVersion>8.1.0-preview</OfficialVersion>
<OfficialVersion>8.2.0-preview</OfficialVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(CDP_PATCH_NUMBER)'!='' AND '$(CDP_BUILD_TYPE)'=='Official'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<!-- Nuget Package Version Settings -->

<PropertyGroup>
<OfficialVersion>8.1.0-preview</OfficialVersion>
<OfficialVersion>8.2.0-preview</OfficialVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(CDP_PATCH_NUMBER)'!='' AND '$(CDP_BUILD_TYPE)'=='Official'">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
//
using Azure.Core;
using Azure.Data.AppConfiguration;
using Microsoft.Extensions.Azure;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Microsoft.Extensions.Configuration.AzureAppConfiguration
{
internal class AzureAppConfigurationClientFactory : IAzureClientFactory<ConfigurationClient>
{
private readonly ConfigurationClientOptions _clientOptions;

private readonly TokenCredential _credential;
private readonly IEnumerable<string> _connectionStrings;

public AzureAppConfigurationClientFactory(
IEnumerable<string> connectionStrings,
ConfigurationClientOptions clientOptions)
{
if (connectionStrings == null || !connectionStrings.Any())
{
throw new ArgumentNullException(nameof(connectionStrings));
}

_connectionStrings = connectionStrings;

_clientOptions = clientOptions ?? throw new ArgumentNullException(nameof(clientOptions));
}

public AzureAppConfigurationClientFactory(
TokenCredential credential,
ConfigurationClientOptions clientOptions)
{
_credential = credential ?? throw new ArgumentNullException(nameof(credential));
_clientOptions = clientOptions ?? throw new ArgumentNullException(nameof(clientOptions));
}

public ConfigurationClient CreateClient(string endpoint)
{
if (string.IsNullOrEmpty(endpoint))
{
throw new ArgumentNullException(nameof(endpoint));
}

if (!Uri.TryCreate(endpoint, UriKind.Absolute, out Uri uriResult))
{
throw new ArgumentException("Invalid host URI.");
}

if (_credential != null)
{
return new ConfigurationClient(uriResult, _credential, _clientOptions);
}

string connectionString = _connectionStrings.FirstOrDefault(cs => ConnectionStringUtils.Parse(cs, ConnectionStringUtils.EndpointSection) == endpoint);

//
// falback to the first connection string
if (connectionString == null)
{
string id = ConnectionStringUtils.Parse(_connectionStrings.First(), ConnectionStringUtils.IdSection);
string secret = ConnectionStringUtils.Parse(_connectionStrings.First(), ConnectionStringUtils.SecretSection);

connectionString = ConnectionStringUtils.Build(uriResult, id, secret);
}

return new ConfigurationClient(connectionString, _clientOptions);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ private static bool IsProviderDisabled()
/// </summary>
/// <param name="configurationBuilder">The configuration builder to add key-values to.</param>
/// <param name="connectionString">The connection string used to connect to the configuration store.</param>
/// <param name="optional">Determines the behavior of the App Configuration provider when an exception occurs while loading data from server. If false, the exception is thrown. If true, the exception is suppressed and no settings are populated from Azure App Configuration.</param>
/// <param name="optional">Determines the behavior of the App Configuration provider when an exception occurs while loading data from server. If false, the exception is thrown. If true, the exception is suppressed and no settings are populated from Azure App Configuration.
/// <exception cref="ArgumentException"/> will always be thrown when the caller gives an invalid input configuration (connection strings, endpoints, key/label filters...etc).
/// </param>
/// <returns>The provided configuration builder.</returns>
public static IConfigurationBuilder AddAzureAppConfiguration(
this IConfigurationBuilder configurationBuilder,
Expand All @@ -48,7 +50,9 @@ public static IConfigurationBuilder AddAzureAppConfiguration(
/// </summary>
/// <param name="configurationBuilder">The configuration builder to add key-values to.</param>
/// <param name="connectionStrings">The list of connection strings used to connect to the configuration store and its replicas.</param>
/// <param name="optional">Determines the behavior of the App Configuration provider when an exception occurs while loading data from server. If false, the exception is thrown. If true, the exception is suppressed and no settings are populated from Azure App Configuration.</param>
/// <param name="optional">Determines the behavior of the App Configuration provider when an exception occurs while loading data from server. If false, the exception is thrown. If true, the exception is suppressed and no settings are populated from Azure App Configuration.
/// <exception cref="ArgumentException"/> will always be thrown when the caller gives an invalid input configuration (connection strings, endpoints, key/label filters...etc).
/// </param>
/// <returns>The provided configuration builder.</returns>
public static IConfigurationBuilder AddAzureAppConfiguration(
this IConfigurationBuilder configurationBuilder,
Expand All @@ -63,7 +67,9 @@ public static IConfigurationBuilder AddAzureAppConfiguration(
/// </summary>
/// <param name="configurationBuilder">The configuration builder to add key-values to.</param>
/// <param name="action">A callback used to configure Azure App Configuration options.</param>
/// <param name="optional">Determines the behavior of the App Configuration provider when an exception occurs while loading data from server. If false, the exception is thrown. If true, the exception is suppressed and no settings are populated from Azure App Configuration.</param>
/// <param name="optional">Determines the behavior of the App Configuration provider when an exception occurs while loading data from server. If false, the exception is thrown. If true, the exception is suppressed and no settings are populated from Azure App Configuration.
/// <exception cref="ArgumentException"/> will always be thrown when the caller gives an invalid input configuration (connection strings, endpoints, key/label filters...etc).
/// </param>
/// <returns>The provided configuration builder.</returns>
public static IConfigurationBuilder AddAzureAppConfiguration(
this IConfigurationBuilder configurationBuilder,
Expand Down
Loading