Skip to content

Commit

Permalink
Update Program.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno authored Jan 5, 2024
1 parent 3b5f2c8 commit 90400cb
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions dotnet-feature-flags/Store/Program.cs
Original file line number Diff line number Diff line change
@@ -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<ProductService>();
builder.Services.AddHttpClient<ProductService>(c =>
Expand Down Expand Up @@ -48,6 +42,7 @@
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();

app.UseAzureAppConfiguration();

// Add the App Configuration middleware

app.Run();

0 comments on commit 90400cb

Please sign in to comment.