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
#Customer intent: As a .NET developer, I want to use feature flags to control feature availability quickly and confidently.
15
15
---
@@ -63,68 +63,9 @@ You can use Visual Studio to create a new console app project.
63
63
using Microsoft.FeatureManagement;
64
64
```
65
65
66
-
1. Update *Program.cs*. to connect to your App Configuration store using Microsoft Entra ID (recommended) or a connection string, and specify 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.
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.
67
67
68
-
### [Microsoft Entra ID (recommended)](#tab/entra-id)
69
-
70
-
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.
71
-
72
-
#### .NET
73
-
74
-
```csharp
75
-
IConfiguration configuration = new ConfigurationBuilder()
options.Connect(new Uri(endpoint), new DefaultAzureCredential());
107
-
.UseFeatureFlags();
108
-
}).Build();
109
-
110
-
IFeatureDefinitionProvider featureDefinitionProvider = new ConfigurationFeatureDefinitionProvider(configuration);
111
-
112
-
IVariantFeatureManager featureManager = new FeatureManager(
113
-
featureDefinitionProvider,
114
-
new FeatureManagementOptions());
115
-
116
-
if (await featureManager.IsEnabledAsync("Beta"))
117
-
{
118
-
Console.WriteLine("Welcome to the beta!");
119
-
}
120
-
121
-
Console.WriteLine("Hello World!");
122
-
}
123
-
```
124
-
125
-
### [Connection string](#tab/connection-string)
126
-
127
-
#### .NET
68
+
### [.NET](#tab/dotnet)
128
69
129
70
```csharp
130
71
IConfiguration configuration = new ConfigurationBuilder()
@@ -148,7 +89,7 @@ You can use Visual Studio to create a new console app project.
148
89
Console.WriteLine("Hello World!");
149
90
```
150
91
151
-
#### .NET Framework
92
+
### [.NET Framework](#tab/dotnet-framework)
152
93
153
94
```csharp
154
95
public static async Task Main(string[] args)
@@ -174,53 +115,31 @@ You can use Visual Studio to create a new console app project.
174
115
Console.WriteLine("Hello World!");
175
116
}
176
117
```
118
+
177
119
---
178
120
179
121
## Build and run the app locally
180
122
181
-
1. Set an environment variable.
182
-
183
-
### [Microsoft Entra ID (recommended)](#tab/entra-id)
184
-
185
-
Set an environment variable named **Endpoint** to the endpoint of your App Configuration store found under the **Overview** of your store in the Azure portal.
186
-
187
-
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
Restart the command prompt to allow the change to take effect. Validate that it's set properly by printing the value of the environment variable.
206
134
207
-
Set an environment variable named **ConnectionString** to the read-only connection string of your App Configuration store found under **Access settings** of your store in the Azure portal.
135
+
### [PowerShell](#tab/powershell)
208
136
209
-
If you use the Windows command prompt, run the following command:
137
+
If you use Windows PowerShell, run the following command.
0 commit comments