Skip to content

Commit f91e64a

Browse files
Merge pull request #291131 from maud-lv/ml-EntraIDaspnet
Add Entra ID tabs to ASP.Net dynamic config and feature flag docs
2 parents b384c6a + f850427 commit f91e64a

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

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

Lines changed: 9 additions & 7 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: 02/20/2024
9+
ms.date: 12/10/2024
1010
ms.author: zhenlwa
1111
ms.custom: devx-track-csharp
1212
---
@@ -35,17 +35,19 @@ 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.
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.
3939

40+
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).
41+
4042
```csharp
4143
// Load configuration from Azure App Configuration
4244
builder.Configuration.AddAzureAppConfiguration(options =>
4345
{
44-
options.Connect(connectionString)
45-
// Load all keys that start with `TestApp:` and have no label
46-
.Select("TestApp:*", LabelFilter.Null)
47-
// Configure to reload configuration if the registered sentinel key is modified
48-
.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 =>
4951
refreshOptions.Register("TestApp:Settings:Sentinel", refreshAll: true));
5052
});
5153
```

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: 7 additions & 8 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: 02/20/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,19 +41,18 @@ 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.
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.
4545
4646
```csharp
4747
// Load configuration from Azure App Configuration
4848
builder.Configuration.AddAzureAppConfiguration(options =>
4949
{
50-
options.Connect(connectionString)
51-
// Load all keys that start with `TestApp:` and have no label
52-
.Select("TestApp:*", LabelFilter.Null)
53-
// Configure to reload configuration if the registered sentinel key is modified
54-
.ConfigureRefresh(refreshOptions =>
50+
options.Connect(new Uri(endpoint), new DefaultAzureCredential());
51+
// Load all keys that start with `TestApp:` and have no label
52+
.Select("TestApp:*", LabelFilter.Null)
53+
// Configure to reload configuration if the registered sentinel key is modified
54+
.ConfigureRefresh(refreshOptions =>
5555
refreshOptions.Register("TestApp:Settings:Sentinel", refreshAll: true));
56-
5756
// Load all feature flags with no label
5857
options.UseFeatureFlags();
5958
});

0 commit comments

Comments
 (0)