From 90400cbf0f2e21f2a1aa63c03189bbfee23e9fe2 Mon Sep 17 00:00:00 2001 From: James Montemagno Date: Fri, 5 Jan 2024 11:42:58 -0800 Subject: [PATCH] Update Program.cs --- dotnet-feature-flags/Store/Program.cs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/dotnet-feature-flags/Store/Program.cs b/dotnet-feature-flags/Store/Program.cs index bb43d69..e630221 100644 --- a/dotnet-feature-flags/Store/Program.cs +++ b/dotnet-feature-flags/Store/Program.cs @@ -1,22 +1,16 @@ using Store.Components; using Store.Services; -using Microsoft.FeatureManagement; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Configuration.AzureAppConfiguration; + var builder = WebApplication.CreateBuilder(args); // Retrieve the connection string -string connectionString = builder.Configuration.GetConnectionString("AppConfig"); + // Load configuration from Azure App Configuration -builder.Configuration.AddAzureAppConfiguration(options => { - options.Connect(connectionString) - .UseFeatureFlags(); -}); -builder.Services.AddFeatureManagement(); -builder.Services.AddAzureAppConfiguration(); + +// Register the Feature Management library's services builder.Services.AddSingleton(); builder.Services.AddHttpClient(c => @@ -48,6 +42,7 @@ app.MapRazorComponents() .AddInteractiveServerRenderMode(); -app.UseAzureAppConfiguration(); + +// Add the App Configuration middleware app.Run();