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/feature-management-dotnet-reference.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,13 @@ title: .NET feature flag management
3
3
titleSuffix: Azure App Configuration
4
4
description: Learn to implement feature flags in your .NET and ASP.NET Core applications using feature management and Azure App Configuration. Dynamically manage feature rollouts, conduct A/B testing, and control feature visibility without redeploying the app.
5
5
services: azure-app-configuration
6
-
author: zhiyuanliang-ms
7
-
ms.author: zhiyuanliang
6
+
author: rossgrambo
7
+
ms.author: rossgrambo
8
8
ms.service: azure-app-configuration
9
9
ms.devlang: csharp
10
10
ms.custom: devx-track-dotnet
11
11
ms.topic: tutorial
12
-
ms.date: 05/22/2024
13
-
zone_pivot_groups: feature-management
12
+
ms.date: 01/07/2024
14
13
#Customer intent: I want to control feature availability in my app by using the Feature Management library.
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/howto-targetingfilter-aspnet-core.md
+4-10Lines changed: 4 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,9 +138,8 @@ In this section, you create a web application that allows users to sign in and u
138
138
// ... ...
139
139
```
140
140
141
-
> [!NOTE]
142
-
> For Blazor applications, see [instructions](./faq.yml#how-to-enable-feature-management-in-blazor-applications-or-as-scoped-services-in--net-applications) for enabling feature management as scoped services.
143
-
141
+
---
142
+
144
143
1. Enable configuration and feature flag refresh from Azure App Configuration with the App Configuration middleware.
145
144
146
145
Update Program.cs withe the following code.
@@ -202,11 +201,11 @@ In this section, you create a web application that allows users to sign in and u
202
201
203
202
The targeting filter evaluates a user's feature state based on the user's targeting context, which comprises the user ID and the groups the user belongs to. In this example, you can use the signed-in user's email address as the user ID and the domain name of the email address as the group.
204
203
205
-
To get targeting context for users automatically (instead of manually constructing a targeting context each time), an implementation of `ITargetingContextAccessor` is required. There's two options for adding an `ITargetingContextAccessor` to your application:
204
+
To get targeting context for users automatically (instead of manually constructing a targeting context each time), an implementation of [ITargetingContextAccessor](./feature-management-dotnet-reference.md#itargetingcontextaccessor) is required.
206
205
207
206
### Default Targeting Accessor
208
207
209
-
To add a default implementation of `ITargetingContextAccessor` use the `WithTargeting()` extension on the feature management builder as seen below. The default uses `HttpContext.User.Identity.Name` as `UserId` and uses `HttpContext.User.Claims` of type `Role` for `Groups`. You can see how the accessor works by looking at the [DefaultHttpTargetingContextAccessor](https://github.com/microsoft/FeatureManagement-Dotnet/blob/main/src/Microsoft.FeatureManagement.AspNetCore/DefaultHttpTargetingContextAccessor.cs).
208
+
To add the default implementation of `ITargetingContextAccessor` use the `WithTargeting()` extension on the feature management builder as seen below. The default uses `HttpContext.User.Identity.Name` as `UserId` and uses `HttpContext.User.Claims` of type `Role` for `Groups`. You can see how the accessor works by looking at the [DefaultHttpTargetingContextAccessor](https://github.com/microsoft/FeatureManagement-Dotnet/blob/main/src/Microsoft.FeatureManagement.AspNetCore/DefaultHttpTargetingContextAccessor.cs).
Now sign in as `[email protected]`, using the password you set when registering the account. The **Beta** item doesn't appear on the toolbar, because `[email protected]` is specified as an excluded user.
243
242
244
-
If you used the `ExampleTargetingContextAccessor`
245
-
246
-
* You can create more users with `@contoso.com` and `@contoso-xyz.com` email addresses to see the behavior of the group settings.
247
-
* Users with `contoso-xyz.com` email addresses won't see the **Beta** item. While 50% of users with `@contoso.com` email addresses will see the **Beta** item, the other 50% won't see the **Beta** item.
248
-
249
243
## Next steps
250
244
251
245
To learn more about the feature filters, continue to the following documents.
0 commit comments