Skip to content

Commit f850427

Browse files
committed
Updates from review
1 parent 0965d1d commit f850427

File tree

3 files changed

+14
-55
lines changed

3 files changed

+14
-55
lines changed

articles/azure-app-configuration/enable-dynamic-configuration-aspnet-core.md

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: zhenlan
66
ms.service: azure-app-configuration
77
ms.devlang: csharp
88
ms.topic: tutorial
9-
ms.date: 11/27/2024
9+
ms.date: 12/10/2024
1010
ms.author: zhenlwa
1111
ms.custom: devx-track-csharp
1212
---
@@ -35,41 +35,22 @@ A *sentinel key* is a key that you update after you complete the change of all o
3535

3636
## Reload data from App Configuration
3737

38-
1. Open *Program.cs*, and update the `AddAzureAppConfiguration` method you added previously during the quickstart. Connect to App Configuration using Microsoft Entra ID (recommended), or a connection string.
39-
40-
### [Microsoft Entra ID (recommended)](#tab/entra-id)
38+
1. Open *Program.cs*, and update the `AddAzureAppConfiguration` method you added during the quickstart. You can connect to App Configuration using either Microsoft Entra ID (recommended) or a connection string. The following code snippet demonstrates using Microsoft Entra ID.
4139

4240
You use the `DefaultAzureCredential` to authenticate to your App Configuration store. While completing the quickstart listed in the prerequisites, you already [assigned your credential the **App Configuration Data Reader role**](./concept-enable-rbac.md#authentication-with-token-credentials).
43-
44-
```csharp
45-
// Load configuration from Azure App Configuration
46-
builder.Configuration.AddAzureAppConfiguration(options =>
47-
{
48-
string endpoint = builder.Configuration.Get("Endpoints:AppConfiguration");
49-
options.Connect(new Uri(endpoint), new DefaultAzureCredential());
50-
// Load all keys that start with `TestApp:` and have no label
51-
.Select("TestApp:*", LabelFilter.Null)
52-
// Configure to reload configuration if the registered sentinel key is modified
53-
.ConfigureRefresh(refreshOptions =>
54-
refreshOptions.Register("TestApp:Settings:Sentinel", refreshAll: true));
55-
});
56-
```
57-
58-
### [Connection string](#tab/connection-string)
5941

6042
```csharp
6143
// Load configuration from Azure App Configuration
6244
builder.Configuration.AddAzureAppConfiguration(options =>
6345
{
64-
options.Connect(connectionString)
65-
// Load all keys that start with `TestApp:` and have no label
66-
.Select("TestApp:*", LabelFilter.Null)
67-
// Configure to reload configuration if the registered sentinel key is modified
68-
.ConfigureRefresh(refreshOptions =>
46+
options.Connect(new Uri(endpoint), new DefaultAzureCredential());
47+
// Load all keys that start with `TestApp:` and have no label
48+
.Select("TestApp:*", LabelFilter.Null)
49+
// Configure to reload configuration if the registered sentinel key is modified
50+
.ConfigureRefresh(refreshOptions =>
6951
refreshOptions.Register("TestApp:Settings:Sentinel", refreshAll: true));
7052
});
7153
```
72-
---
7354

7455
The `Select` method is used to load all key-values whose key name starts with *TestApp:* and that have *no label*. You can call the `Select` method more than once to load configurations with different prefixes or labels. If you share one App Configuration store with multiple apps, this approach helps load configuration only relevant to your current app instead of loading everything from your store.
7556

articles/azure-app-configuration/quickstart-aspnet-core-app.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: azure-app-configuration
77
ms.devlang: csharp
88
ms.custom: devx-track-csharp, mode-other, engagement-fy23
99
ms.topic: quickstart
10-
ms.date: 11/20/2024
10+
ms.date: 12/10/2024
1111
ms.author: zhenlwa
1212
#Customer intent: As an ASP.NET Core developer, I want to learn how to manage all my app settings in one place.
1313
---
@@ -123,13 +123,15 @@ Connect to your App Configuration store using Microsoft Entra ID (recommended),
123123
```csharp
124124
var builder = WebApplication.CreateBuilder(args);
125125
126+
// Retrieve the endpoint
127+
string endpoint = builder.Configuration.Get("Endpoints:AppConfiguration");
128+
126129
// Load configuration from Azure App Configuration
127130
builder.Configuration.AddAzureAppConfiguration(options =>
128131
{
129-
string endpoint = builder.Configuration.Get("Endpoints:AppConfiguration");
130132
options.Connect(new Uri(endpoint), new DefaultAzureCredential());
131133
});
132-
134+
133135
// The rest of existing code in program.cs
134136
// ... ...
135137
```

articles/azure-app-configuration/quickstart-feature-flag-aspnet-core.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: azure-app-configuration
88
ms.devlang: csharp
99
ms.custom: devx-track-csharp, mode-other
1010
ms.topic: quickstart
11-
ms.date: 11/27/2024
11+
ms.date: 12/10/2024
1212
ms.author: zhenlwa
1313
#Customer intent: As an ASP.NET Core developer, I want to use feature flags to control feature availability quickly and confidently.
1414
---
@@ -41,46 +41,22 @@ Add a feature flag called *Beta* to the App Configuration store (created in the
4141
dotnet add package Microsoft.FeatureManagement.AspNetCore
4242
```
4343
44-
1. Open *Program.cs*, and add a call to the `UseFeatureFlags` method inside the `AddAzureAppConfiguration` call. Connect to App Configuration using Microsoft Entra ID (recommended), or a connection string.
45-
46-
### [Microsoft Entra ID (recommended)](#tab/entra-id)
44+
1. Open *Program.cs*, and add a call to the `UseFeatureFlags` method inside the `AddAzureAppConfiguration` call. You can connect to App Configuration using either Microsoft Entra ID (recommended) or a connection string. The following code snippet demonstrates using Microsoft Entra ID.
4745
4846
```csharp
4947
// Load configuration from Azure App Configuration
5048
builder.Configuration.AddAzureAppConfiguration(options =>
5149
{
52-
string endpoint = builder.Configuration.Get("Endpoints:AppConfiguration");
5350
options.Connect(new Uri(endpoint), new DefaultAzureCredential());
54-
55-
// Load all keys that start with `TestApp:` and have no label
56-
.Select("TestApp:*", LabelFilter.Null)
57-
// Configure to reload configuration if the registered sentinel key is modified
58-
.ConfigureRefresh(refreshOptions =>
59-
refreshOptions.Register("TestApp:Settings:Sentinel", refreshAll: true));
60-
61-
// Load all feature flags with no label
62-
options.UseFeatureFlags();
63-
});
64-
```
65-
66-
### [Connection string](#tab/connection-string)
67-
68-
```csharp
69-
// Load configuration from Azure App Configuration
70-
builder.Configuration.AddAzureAppConfiguration(options =>
71-
{
72-
options.Connect(connectionString)
7351
// Load all keys that start with `TestApp:` and have no label
7452
.Select("TestApp:*", LabelFilter.Null)
7553
// Configure to reload configuration if the registered sentinel key is modified
7654
.ConfigureRefresh(refreshOptions =>
7755
refreshOptions.Register("TestApp:Settings:Sentinel", refreshAll: true));
78-
7956
// Load all feature flags with no label
8057
options.UseFeatureFlags();
8158
});
8259
```
83-
---
8460
8561
> [!TIP]
8662
> When no parameter is passed to the `UseFeatureFlags` method, it loads *all* feature flags with *no label* in your App Configuration store. The default refresh interval of feature flags is 30 seconds. You can customize this behavior via the `FeatureFlagOptions` parameter. For example, the following code snippet loads only feature flags that start with *TestApp:* in their *key name* and have the label *dev*. The code also changes the refresh interval time to 5 minutes. Note that this refresh interval time is separate from that for regular key-values.

0 commit comments

Comments
 (0)