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-aspnet-core-app.md
+8-12Lines changed: 8 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,12 +64,6 @@ Connect to your App Configuration store using Microsoft Entra ID (recommended),
64
64
```
65
65
---
66
66
67
-
1. Run the following command to restore packages for your project:
68
-
69
-
```dotnetcli
70
-
dotnet restore
71
-
```
72
-
73
67
1. Create a user secret for the application by navigating into the *TestAppConfig* folder and running the following command.
74
68
75
69
### [Microsoft Entra ID (recommended)](#tab/entra-id)
@@ -83,11 +77,11 @@ Connect to your App Configuration store using Microsoft Entra ID (recommended),
83
77
84
78
### [Connection string](#tab/connection-string)
85
79
86
-
The command uses [Secret Manager](/aspnet/core/security/app-secrets) to store a secret named `ConnectionStrings:AppConfig`, which stores the connection string for your App Configuration store. Replace the `<your_connection_string>` placeholder with your App Configuration store's connection string. You can find the connection string in your App Configuration store's **Access settings** in the Azure portal.
80
+
The command uses [Secret Manager](/aspnet/core/security/app-secrets) to store a secret named `ConnectionStrings:AppConfiguration`, which stores the connection string for your App Configuration store. Replace the `<your-App-Configuration-connection-string>` placeholder with your App Configuration store's read-only connection string. You can find the connection string in your App Configuration store's **Access settings** in the Azure portal.
87
81
88
82
```dotnetcli
89
83
dotnet user-secrets init
90
-
dotnet user-secrets set ConnectionStrings:AppConfig "<your_connection_string>"
84
+
dotnet user-secrets set ConnectionStrings:AppConfiguration "<your-App-Configuration-connection-string>"
91
85
```
92
86
93
87
> [!TIP]
@@ -124,15 +118,16 @@ Connect to your App Configuration store using Microsoft Entra ID (recommended),
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/use-variant-feature-flags-aspnet-core.md
+18-12Lines changed: 18 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
---
2
-
title: 'Tutorial: Use variant feature flags from Azure App Configuration in an ASP.NET application'
2
+
title: 'Tutorial: Use variant feature flags from Azure App Configuration in an ASP.NET Core application'
3
3
titleSuffix: Azure App configuration
4
-
description: In this tutorial, you learn how to use variant feature flags in an ASP.NET application
4
+
description: In this tutorial, you learn how to use variant feature flags in an ASP.NET Core application
5
5
#customerintent: As a user of Azure App Configuration, I want to learn how I can use variants and variant feature flags in my ASP.NET application.
6
6
author: rossgrambo
7
7
ms.author: rossgrambo
8
8
ms.service: azure-app-configuration
9
9
ms.devlang: csharp
10
10
ms.topic: tutorial
11
-
ms.date: 10/18/2024
11
+
ms.date: 12/18/2024
12
12
---
13
13
14
-
# Tutorial: Use variant feature flags from Azure App Configuration in an ASP.NET application
14
+
# Tutorial: Use variant feature flags in an ASP.NET Core application
15
15
16
16
In this tutorial, you use a variant feature flag to manage experiences for different user segments in an example application, *Quote of the Day*. You utilize the variant feature flag created in [Use variant feature flags](./use-variant-feature-flags.md). Before proceeding, ensure you create the variant feature flag named *Greeting* in your App Configuration store.
17
17
@@ -28,10 +28,11 @@ In this tutorial, you use a variant feature flag to manage experiences for diffe
28
28
dotnet new razor --auth Individual -o QuoteOfTheDay
29
29
```
30
30
31
-
1. Create a [user secret](/aspnet/core/security/app-secrets) for the application by navigating into the *QuoteOfTheDay* folder and run the following command. This secret holds the endpoint for your App Configuration.
31
+
1. Navigate to the *QuoteOfTheDay* directory and create a [user secret](/aspnet/core/security/app-secrets) for the application by running the following commands. Replace the `<your-App-Configuration-endpoint>` placeholder with your App Configuration store's endpoint. You can find the endpoint in your App Configuration store's **Overview** blade in the Azure portal.
32
32
33
33
```dotnetcli
34
-
dotnet user-secrets set Endpoints:AppConfiguration "<App Configuration Endpoint>"
34
+
dotnet user-secrets init
35
+
dotnet user-secrets set Endpoints:AppConfiguration "<your-App-Configuration-endpoint>"
35
36
```
36
37
37
38
1. Add the latest versions of the required packages.
@@ -44,26 +45,31 @@ In this tutorial, you use a variant feature flag to manage experiences for diffe
44
45
45
46
## Connect to App Configuration for feature management
46
47
47
-
1. In *Program.cs*, add the following using statements.
48
+
1. Open *Program.cs* and add the following using statements.
48
49
49
50
```csharp
50
51
using Azure.Identity;
51
52
using Microsoft.Extensions.Configuration.AzureAppConfiguration;
52
53
using Microsoft.FeatureManagement;
53
54
```
54
55
55
-
1. In *Program.cs*, under the line `var builder = WebApplication.CreateBuilder(args);`, add the App Configuration provider, which pulls down the configuration from Azure App Configuration when the application starts. By default, the `UseFeatureFlags` method pulls down all feature flags with no label.
56
+
1. Add the following code to connect to your App Configuration store and call `UseFeatureFlags` to pull down all feature flags with no label.
56
57
57
58
You use the `DefaultAzureCredential` to authenticate to your App Configuration store. 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.
0 commit comments