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
+62-5Lines changed: 62 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,13 @@ Use the [.NET Core command-line interface (CLI)](https://docs.microsoft.com/dotn
49
49
50
50
Add the [Secret Manager tool](https://docs.microsoft.com/aspnet/core/security/app-secrets) to your project. The Secret Manager tool stores sensitive data for development work outside your project tree. This approach helps prevent the accidental sharing of app secrets within source code.
51
51
52
+
> [!IMPORTANT]
53
+
> Significant differences exist between .NET Core 2.x and 3.x. Select the correct syntax based on your environment.
54
+
52
55
1. Open the *.csproj* file.
53
56
1. Add a `UserSecretsId` element as shown in the following example, and replace its value with your own, which typically is a GUID:
54
57
58
+
#### [.NET Core 2.x](#tab/core2x)
55
59
```xml
56
60
<ProjectSdk="Microsoft.NET.Sdk.Web">
57
61
@@ -67,14 +71,25 @@ Add the [Secret Manager tool](https://docs.microsoft.com/aspnet/core/security/ap
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:
@@ -150,28 +165,70 @@ Add the [Secret Manager tool](https://docs.microsoft.com/aspnet/core/security/ap
150
165
151
166
1. Update the `ConfigureServices` method to add feature flag support by calling the `services.AddFeatureManagement()` method. Optionally, you can include any filter to be used with feature flags by calling `services.AddFeatureFilter<FilterType>()`:
152
167
168
+
#### [.NET Core 2.x](#tab/core2x)
153
169
```csharp
154
170
public void ConfigureServices(IServiceCollection services)
1. Update the `Configure` method to add a middleware to allow the feature flag values to be refreshed at a recurring interval while the ASP.NET Core web app continues to receive requests.
161
185
162
186
#### [.NET Core 2.x](#tab/core2x)
163
187
```csharp
164
188
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
0 commit comments