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-dotnet.md
+87-17Lines changed: 87 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,40 +46,113 @@ You can use Visual Studio to create a new console app project.
46
46
47
47
## Use the feature flag
48
48
49
-
1. Right-click your project, and select **Manage NuGet Packages**. On the **Browse** tab, search and add the following NuGet packages to your project.
49
+
1. Right-click your project and select **Manage NuGet Packages**. On the **Browse** tab, search and add the latest stable versions of the following NuGet packages to your project.
50
+
51
+
### [Microsoft Entra ID (recommended)](#tab/entra-id)
1. Open *Program.cs* and add the following statements.
59
68
69
+
### [Microsoft Entra ID (recommended)](#tab/entra-id)
70
+
71
+
```csharp
72
+
using Microsoft.Extensions.Configuration;
73
+
using Microsoft.Extensions.Configuration.AzureAppConfiguration;
74
+
using Microsoft.FeatureManagement;
75
+
using Azure.Identity;
76
+
```
77
+
78
+
### [Connection string](#tab/connection-string)
79
+
60
80
```csharp
61
81
using Microsoft.Extensions.Configuration;
62
82
using Microsoft.Extensions.Configuration.AzureAppConfiguration;
63
83
using Microsoft.FeatureManagement;
64
84
```
85
+
---
86
+
87
+
1. Update the *Program.cs* file and add a call to the `UseFeatureFlags` method to load feature flags from App Configuration. Then create a `FeatureManager` to read feature flags from the configuration. Finally, display a message if the *Beta* feature flag is enabled.
65
88
66
-
1. Connect to App Configuration, specifying the `UseFeatureFlags` option so that feature flags are retrieved. Create a `ConfigurationFeatureDefinitionProvider` to provide feature flag definition from the configuration and a `FeatureManager` to evaluate feature flags' state. Then display a message if the `Beta` feature flag is enabled.
89
+
You can connect to your App Configuration store using Microsoft Entra ID (recommended) or a connection string.
67
90
68
-
### [.NET](#tab/dotnet)
91
+
### [Microsoft Entra ID (recommended)](#tab/entra-id)
92
+
93
+
You use the `DefaultAzureCredential` to authenticate to your App Configuration store by default. Follow the [instructions](./concept-enable-rbac.md#authentication-with-token-credentials) to assign your credential the **App Configuration Data Reader** role. Be sure to allow sufficient time for the permission to propagate before running your application.
94
+
95
+
#### .NET
69
96
70
97
```csharp
71
98
IConfiguration configuration = new ConfigurationBuilder()
0 commit comments