You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/quickstart-feature-flag-aspnet-core.md
+2-8Lines changed: 2 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,8 +82,8 @@ Add the [Secret Manager tool](https://docs.microsoft.com/aspnet/core/security/ap
82
82
1. Add reference to the `Microsoft.Azure.AppConfiguration.AspNetCore` and the `Microsoft.FeatureManagement.AspNetCore` NuGet packages by running the following commands:
1. Run the following command to restore packages for your project:
@@ -106,12 +106,6 @@ Add the [Secret Manager tool](https://docs.microsoft.com/aspnet/core/security/ap
106
106
107
107
You can access this secret with the App Configuration API. A colon (:) works in the configuration name with the App Configuration API on all supported platforms. See [Configuration by environment](https://docs.microsoft.com/aspnet/core/fundamentals/configuration).
108
108
109
-
1. Open *Program.cs*, and add a reference to the .NET Core App Configuration provider:
110
-
111
-
```csharp
112
-
using Microsoft.Extensions.Configuration.AzureAppConfiguration;
113
-
```
114
-
115
109
1. Update the `CreateWebHostBuilder` method to use App Configuration by calling the `config.AddAzureAppConfiguration()` method.
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/quickstart-feature-flag-dotnet.md
+22-12Lines changed: 22 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,22 +64,32 @@ The .NET Feature Management libraries extend the framework with comprehensive fe
64
64
1. Update the `Main` method to connect to App Configuration, specifying the `UseFeatureFlags` option so that feature flags are retrieved. Then display a message if the `Beta` feature flag is enabled.
65
65
66
66
```csharp
67
-
static void Main(string[] args)
67
+
public static void Main(string[] args)
68
+
{
69
+
AsyncMain().Wait();
70
+
}
71
+
72
+
private static async Task AsyncMain()
68
73
{
69
74
IConfigurationRoot configuration = new ConfigurationBuilder()
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/use-feature-flags-dotnet-core.md
+2-12Lines changed: 2 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -175,7 +175,7 @@ The basic pattern of feature management is to first check if a feature flag is s
175
175
```csharp
176
176
IFeatureManagerfeatureManager;
177
177
...
178
-
if (featureManager.IsEnabled(nameof(MyFeatureFlags.FeatureA)))
178
+
if (awaitfeatureManager.IsEnabledAsync(nameof(MyFeatureFlags.FeatureA)))
179
179
{
180
180
// Run the following code
181
181
}
@@ -252,7 +252,7 @@ The feature `<feature>` tag can also be used to show content if any or all featu
252
252
253
253
## MVC filters
254
254
255
-
You can set up MVC filters so that they're activated based on the state of a feature flag. The following code adds an MVC filter named `SomeMvcFilter`. This filter is triggered within the MVC pipeline only if `FeatureA` is enabled.
255
+
You can set up MVC filters so that they're activated based on the state of a feature flag. The following code adds an MVC filter named `SomeMvcFilter`. This filter is triggered within the MVC pipeline only if `FeatureA` is enabled. This capability is limited to `IAsyncActionFilter`.
256
256
257
257
```csharp
258
258
usingMicrosoft.FeatureManagement.FeatureFilters;
@@ -267,16 +267,6 @@ public void ConfigureServices(IServiceCollection services)
267
267
}
268
268
```
269
269
270
-
## Routes
271
-
272
-
You can use feature flags to dynamically expose routes. The following code adds a route, which sets `Beta` as the default controller only when `FeatureA` is enabled:
You can also use feature flags to conditionally add application branches and middleware. The following code inserts a middleware component in the request pipeline only when `FeatureA` is enabled:
0 commit comments