Skip to content

Commit 6810b6f

Browse files
Merge pull request #269027 from zhiyuanliang-ms/zhiyuanliang/update-targeting-tutorial
Azure App Config - Update tutorial about using targeting filter
2 parents e790391 + aba4f99 commit 6810b6f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

articles/azure-app-configuration/howto-targetingfilter-aspnet-core.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ In this section, you will create a web application that allows users to sign in
5757
5858
var builder = WebApplication.CreateBuilder(args);
5959
60-
// Retrieve the connection string
61-
string connectionString = builder.Configuration.GetConnectionString("AppConfig");
60+
// Retrieve the App Config connection string
61+
string AppConfigConnectionString = builder.Configuration.GetConnectionString("AppConfig");
6262
6363
// Load configuration from Azure App Configuration
6464
builder.Configuration.AddAzureAppConfiguration(options =>
6565
{
66-
options.Connect(connectionString);
66+
options.Connect(AppConfigConnectionString);
6767
options.UseFeatureFlags();
6868
});
6969
@@ -144,12 +144,6 @@ In this section, you will create a web application that allows users to sign in
144144
145145
At this point, you can use the feature flag to enable or disable the `Beta` feature for all users. To enable the feature flag for some users while disabling it for others, update your code to use `TargetingFilter`. In this example, you use the signed-in user's email address as the user ID, and the domain name portion of the email address as the group. You add the user and group to the `TargetingContext`. The `TargetingFilter` uses this context to determine the state of the feature flag for each request.
146146
147-
1. Update to the latest version of the `Microsoft.FeatureManagement.AspNetCore` package.
148-
149-
```dotnetcli
150-
dotnet add package Microsoft.FeatureManagement.AspNetCore
151-
```
152-
153147
1. Add *ExampleTargetingContextAccessor.cs* file.
154148
155149
```csharp

0 commit comments

Comments
 (0)