Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…otnetProvider into merge-main-to-preview
  • Loading branch information
amerjusupovic committed Jul 26, 2024
2 parents 08e5930 + 42ec7d1 commit 5088fe9
Show file tree
Hide file tree
Showing 46 changed files with 2,387 additions and 325 deletions.
4 changes: 1 addition & 3 deletions build/install-dotnet.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Installs .NET 6, .NET 7, and .NET 8 for CI/CD environment
# Installs .NET 6 and .NET 8 for CI/CD environment
# see: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script#examples

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;

&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 6.0

&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 7.0

&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 8.0
2 changes: 1 addition & 1 deletion examples/ConfigStoreDemo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static IWebHost BuildWebHost(string[] args)
.ConfigureRefresh(refresh =>
{
refresh.Register("Settings:BackgroundColor")
.SetCacheExpiration(TimeSpan.FromSeconds(10));
.SetRefreshInterval(TimeSpan.FromSeconds(10));
});
});
})
Expand Down
2 changes: 1 addition & 1 deletion examples/ConsoleApplication/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private static void Configure()
{
refresh.Register("AppName")
.Register("Language", refreshAll: true)
.SetCacheExpiration(TimeSpan.FromSeconds(10));
.SetRefreshInterval(TimeSpan.FromSeconds(10));
});
// Get an instance of the refresher that can be used to refresh data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\..\build\NugetProperties.props" />

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Description>Microsoft.Azure.AppConfiguration.AspNetCore allows developers to use Microsoft Azure App Configuration service as a configuration source in their applications. This package adds additional features for ASP.NET Core applications to the existing package Microsoft.Extensions.Configuration.AzureAppConfiguration.</Description>
<SignAssembly>true</SignAssembly>
<DelaySign>false</DelaySign>
Expand All @@ -21,7 +21,7 @@
<!-- Nuget Package Version Settings -->

<PropertyGroup>
<OfficialVersion>7.3.0</OfficialVersion>
<OfficialVersion>8.0.0-preview.3</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 @@ -2,7 +2,7 @@
<Import Project="..\..\build\NugetProperties.props" />

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Description>Microsoft.Azure.AppConfiguration.Functions.Worker allows developers to use the Microsoft Azure App Configuration service as a configuration source in their applications. This package adds additional features to the existing package Microsoft.Extensions.Configuration.AzureAppConfiguration for .NET Azure Functions running in an isolated process.</Description>
<SignAssembly>true</SignAssembly>
<DelaySign>false</DelaySign>
Expand All @@ -24,7 +24,7 @@
<!-- Nuget Package Version Settings -->

<PropertyGroup>
<OfficialVersion>7.3.0</OfficialVersion>
<OfficialVersion>8.0.0-preview.3</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 @@ -35,10 +35,15 @@ public class AzureAppConfigurationOptions
private SortedSet<string> _keyPrefixes = new SortedSet<string>(Comparer<string>.Create((k1, k2) => -string.Compare(k1, k2, StringComparison.OrdinalIgnoreCase)));

/// <summary>
/// Flag to indicate whether enable replica discovery.
/// Flag to indicate whether replica discovery is enabled.
/// </summary>
public bool ReplicaDiscoveryEnabled { get; set; } = true;

/// <summary>
/// Flag to indicate whether load balancing is enabled.
/// </summary>
public bool LoadBalancingEnabled { get; set; }

/// <summary>
/// The list of connection strings used to connect to an Azure App Configuration store and its replicas.
/// </summary>
Expand Down Expand Up @@ -119,7 +124,7 @@ internal IEnumerable<IKeyValueAdapter> Adapters
/// <summary>
/// Indicates all types of feature filters used by the application.
/// </summary>
internal FeatureFilterTracing FeatureFilterTracing { get; set; } = new FeatureFilterTracing();
internal FeatureFlagTracing FeatureFlagTracing { get; set; } = new FeatureFlagTracing();

/// <summary>
/// Options used to configure provider startup.
Expand All @@ -135,7 +140,7 @@ public AzureAppConfigurationOptions()
{
new AzureKeyVaultKeyValueAdapter(new AzureKeyVaultSecretProvider()),
new JsonKeyValueAdapter(),
new FeatureManagementKeyValueAdapter(FeatureFilterTracing)
new FeatureManagementKeyValueAdapter(FeatureFlagTracing)
};
}

Expand Down Expand Up @@ -215,10 +220,10 @@ public AzureAppConfigurationOptions UseFeatureFlags(Action<FeatureFlagOptions> c
FeatureFlagOptions options = new FeatureFlagOptions();
configure?.Invoke(options);

if (options.CacheExpirationInterval < RefreshConstants.MinimumFeatureFlagsCacheExpirationInterval)
if (options.RefreshInterval < RefreshConstants.MinimumFeatureFlagRefreshInterval)
{
throw new ArgumentOutOfRangeException(nameof(options.CacheExpirationInterval), options.CacheExpirationInterval.TotalMilliseconds,
string.Format(ErrorMessages.CacheExpirationTimeTooShort, RefreshConstants.MinimumFeatureFlagsCacheExpirationInterval.TotalMilliseconds));
throw new ArgumentOutOfRangeException(nameof(options.RefreshInterval), options.RefreshInterval.TotalMilliseconds,
string.Format(ErrorMessages.RefreshIntervalTooShort, RefreshConstants.MinimumFeatureFlagRefreshInterval.TotalMilliseconds));
}

if (options.FeatureFlagSelectors.Count() != 0 && options.Label != null)
Expand Down Expand Up @@ -247,8 +252,8 @@ public AzureAppConfigurationOptions UseFeatureFlags(Action<FeatureFlagOptions> c
{
Key = featureFlagFilter,
Label = labelFilter,
// If UseFeatureFlags is called multiple times for the same key and label filters, last cache expiration time wins
CacheExpirationInterval = options.CacheExpirationInterval
// If UseFeatureFlags is called multiple times for the same key and label filters, last refresh interval wins
RefreshInterval = options.RefreshInterval
});

}
Expand Down Expand Up @@ -381,7 +386,7 @@ public AzureAppConfigurationOptions ConfigureRefresh(Action<AzureAppConfiguratio

foreach (var item in refreshOptions.RefreshRegistrations)
{
item.CacheExpirationInterval = refreshOptions.CacheExpirationInterval;
item.RefreshInterval = refreshOptions.RefreshInterval;
_changeWatchers.Add(item);
}

Expand Down
Loading

0 comments on commit 5088fe9

Please sign in to comment.