Skip to content

Commit c37c9bd

Browse files
committed
Refresh Use feature filters
1 parent 787da19 commit c37c9bd

9 files changed

+19
-24
lines changed

articles/azure-app-configuration/howto-feature-filters-aspnet-core.md

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
22
title: Use feature filters to enable conditional feature flags
33
titleSuffix: Azure App Configuration
4-
description: Learn how to use feature filters to enable conditional feature flags
4+
description: Learn how to use feature filters in Azure App Configuration to enable conditional feature flags for your app.
55
ms.service: azure-app-configuration
66
ms.devlang: csharp
77
ms.custom: devx-track-csharp
88
author: maud-lv
99
ms.author: malev
10-
ms.topic: conceptual
11-
ms.date: 3/9/2020
10+
ms.topic: how-to
11+
ms.date: 01/12/2024
1212
---
13+
1314
# Use feature filters to enable conditional feature flags
1415

1516
Feature flags allow you to activate or deactivate functionality in your application. A simple feature flag is either on or off. The application always behaves the same way. For example, you could roll out a new feature behind a feature flag. When the feature flag is enabled, all users see the new feature. Disabling the feature flag hides the new feature.
@@ -24,7 +25,7 @@ The `Microsoft.FeatureManagement` library includes three feature filters:
2425

2526
You can also create your own feature filter that implements the Microsoft.FeatureManagement.IFeatureFilter interface.
2627

27-
## Registering a feature filter
28+
## Register a feature filter
2829

2930
You register a feature filter by calling the `AddFeatureFilter` method, specifying the type name of the desired feature filter. For example, the following code registers `PercentageFilter`:
3031

@@ -36,44 +37,38 @@ public void ConfigureServices(IServiceCollection services)
3637
}
3738
```
3839

39-
## Configuring a feature filter in Azure App Configuration
40+
## Configure a feature filter in Azure App Configuration
4041

4142
Some feature filters have additional settings. For example, `PercentageFilter` activates a feature based on a percentage. It has a setting defining the percentage to use.
4243

4344
You can configure these settings for feature flags defined in Azure App Configuration. For example, follow these steps to use `PercentageFilter` to enable the feature flag for 50% of requests to a web app:
4445

4546
1. Follow the instructions in [Quickstart: Add feature flags to an ASP.NET Core app](./quickstart-feature-flag-aspnet-core.md) to create a web app with a feature flag.
4647

47-
1. In the Azure portal, go to your configuration store and click **Feature manager**.
48-
49-
1. Click on the context menu for the *Beta* feature flag that you created in the quickstart. Click **Edit**.
48+
1. In the Azure portal, go to your configuration store and select **Feature manager**.
5049

51-
> [!div class="mx-imgBorder"]
52-
> ![Edit Beta feature flag](./media/edit-beta-feature-flag.png)
50+
:::image type="content" source="./media/feature-filters/edit-beta-feature-flag.png" alt-text="Screenshot of the Azure portal, selecting the Edit option for the Beta feature flag, under Feature manager.":::
5351

54-
1. In the **Edit** screen, check the **Enable feature flag** checkbox if it isn't already enabled. Then check the **Use feature filter** checkbox and select **Custom**.
52+
1. On the Beta feature flag you created in the quickstart, select the context menu and then select **Edit**.
5553

56-
1. In the **Name** field, select *Microsoft.Percentage*.
54+
1. In the **Edit feature flag** pane that opens, check the **Enable feature flag** checkbox if it isn't already enabled. Then check the **Use feature filter** checkbox and select **Create**.
5755

58-
> [!div class="mx-imgBorder"]
59-
> ![Add feature filter](./media/feature-flag-add-filter.png)
56+
:::image type="content" source="./media/feature-filters/edit-a-feature-flag.png" alt-text="Screenshot of the Azure portal, filling out the form 'Edit feature flag'.":::
6057

61-
1. Click the context menu next to the feature filter name. Click **Edit filter parameters**.
58+
1. The pane **Create a new filter** opens. Under **Filter type**, select **Targeting filter** to enable a new filter for specific users or a group.
6259

63-
> [!div class="mx-imgBorder"]
64-
> ![Edit feature filter parameters](./media/feature-flags-edit-filter-parameters.png)
60+
:::image type="content" source="./media/feature-filters/add-targeting-filter.png" alt-text="Screenshot of the Azure portal, creating a new targeting filter.":::
6561

66-
1. Enter a **Name** of *Value* and a **Value** of 50. The **Value** field indicates the percentage of requests for which to enable the feature filter.
62+
1. Optionally expand the **Evaluation flow** menu to see a graph showing how the targeting filter is evaluated in the selected scenario. Leave the **Default Percentage** at 50. The options **Override by Groups** and **Override by Users** let you enable or disable the feature flag for select groups or users. These options are disabled by default.
63+
1. Select **Add** to return to the **Edit feature flag** screen.
6764

68-
> [!div class="mx-imgBorder"]
69-
> ![Set feature filter parameters](./media/feature-flag-set-filter-parameters.png)
65+
1. Select **Apply** again to save the new feature flag settings.
7066

71-
1. Click **Apply** to return to the **Edit feature flag** screen. Then click **Apply** again to save the feature flag settings.
67+
:::image type="content" source="./media/feature-filters/feature-flag-edit-apply-filter.png" alt-text="Screenshot of the Azure portal, applying new targeting filter.":::
7268

73-
1. On the **Feature manager** page, the feature flag now has a **Feature filter** value of *Custom*.
69+
1. On the **Feature manager** page, the feature flag now has a **Feature filter(s)** value of **1**.
7470

75-
> [!div class="mx-imgBorder"]
76-
> ![Feature flag listed with a Feature filter value of "Custom"](./media/feature-flag-filter-custom.png)
71+
:::image type="content" source="./media/feature-filters/updated-feature-flag.png" alt-text="Screenshot of the Azure portal, displaying updated feature flag.":::
7772

7873
## Feature filters in action
7974

31.7 KB
Loading
38.6 KB
Loading
63.8 KB
Loading
31 KB
Loading
51.6 KB
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)