From 2fcb0b1428ab9bf3f084ab62636fdbd1440d92d2 Mon Sep 17 00:00:00 2001 From: Jimmy Campbell Date: Wed, 25 May 2022 11:56:28 -0700 Subject: [PATCH] Update Azure App Configuration provider reference in example project to pull features using v2 schema. --- examples/FeatureFlagDemo/FeatureFlagDemo.csproj | 2 +- examples/FeatureFlagDemo/Program.cs | 5 +++++ examples/FeatureFlagDemo/Startup.cs | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/FeatureFlagDemo/FeatureFlagDemo.csproj b/examples/FeatureFlagDemo/FeatureFlagDemo.csproj index 3bf22dc9..33b04b4f 100644 --- a/examples/FeatureFlagDemo/FeatureFlagDemo.csproj +++ b/examples/FeatureFlagDemo/FeatureFlagDemo.csproj @@ -5,7 +5,7 @@ - + diff --git a/examples/FeatureFlagDemo/Program.cs b/examples/FeatureFlagDemo/Program.cs index c9aff31a..ef411bc9 100644 --- a/examples/FeatureFlagDemo/Program.cs +++ b/examples/FeatureFlagDemo/Program.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. // +using System; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -12,6 +13,10 @@ public class Program { public static void Main(string[] args) { + // + // Opt-in to use new schema with features received from Azure App Configuration + Environment.SetEnvironmentVariable("AZURE_APP_CONFIGURATION_FEATURE_MANAGEMENT_SCHEMA_VERSION", "2"); + CreateWebHostBuilder(args).Build().Run(); } diff --git a/examples/FeatureFlagDemo/Startup.cs b/examples/FeatureFlagDemo/Startup.cs index 11adfb93..8ddba6a1 100644 --- a/examples/FeatureFlagDemo/Startup.cs +++ b/examples/FeatureFlagDemo/Startup.cs @@ -63,6 +63,8 @@ public void ConfigureServices(IServiceCollection services) .AddFeatureVariantAssigner() .UseDisabledFeaturesHandler(new FeatureNotEnabledDisabledHandler()); + services.AddAzureAppConfiguration(); + services.AddMvc(o => { o.Filters.AddForFeature(nameof(MyFeatureFlags.EnhancedPipeline));