Skip to content

Commit 7fc7068

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/azure-docs-pr (branch live)
2 parents e70e436 + 6935e4c commit 7fc7068

File tree

118 files changed

+2937
-1407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2937
-1407
lines changed

articles/api-center/import-api-management-apis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This article shows two options for using the Azure CLI to add APIs to your API c
2727
After importing API definitions or APIs from API Management, you can add metadata and documentation in your API center to help stakeholders discover, understand, and consume the API.
2828

2929
> [!TIP]
30-
> You can also set up automatic synchronization of APIS from API Management to your API center. For more information, see [Link an API Management instance to synchronize APIs to your API center](synchronize-api-management-apis.md).
30+
> You can also set up automatic synchronization of APIs from API Management to your API center. For more information, see [Link an API Management instance to synchronize APIs to your API center](synchronize-api-management-apis.md).
3131
3232
## Prerequisites
3333

articles/api-management/api-management-howto-disaster-recovery-backup-restore.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: dlepow
77

88
ms.service: azure-api-management
99
ms.topic: how-to
10-
ms.date: 09/06/2024
10+
ms.date: 01/06/2025
1111
ms.author: danlep
1212
ms.custom: devx-track-azurepowershell
1313
---
@@ -29,7 +29,8 @@ This article shows how to automate backup and restore operations of your API Man
2929
> Each backup expires after 30 days. If you attempt to restore a backup after the 30-day expiration period has expired, the restore will fail with a `Cannot restore: backup expired` message.
3030
3131
> [!IMPORTANT]
32-
> Restore operation doesn't change custom hostname configuration of the target service. We recommend to use the same custom hostname and TLS certificate for both active and standby services, so that, after restore operation completes, the traffic can be re-directed to the standby instance by a simple DNS CNAME change.
32+
> * Backup and restore aren't supported in the [v2 service tiers](v2-service-tiers-overview.md) or in API Management instances configured with [workspaces](workspaces-overview.md).
33+
> * Restore operation doesn't change custom hostname configuration of the target service. We recommend to use the same custom hostname and TLS certificate for both active and standby services, so that, after restore operation completes, the traffic can be re-directed to the standby instance by a simple DNS CNAME change.
3334
3435

3536
[!INCLUDE [updated-for-az](~/reusable-content/ce-skilling/azure/includes/updated-for-az.md)]

articles/api-management/virtual-network-reference.md

Lines changed: 46 additions & 42 deletions
Large diffs are not rendered by default.

articles/azure-app-configuration/feature-management-dotnet-reference.md

Lines changed: 60 additions & 257 deletions
Large diffs are not rendered by default.

articles/azure-app-configuration/howto-geo-replication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ configurationBuilder.AddAzureAppConfiguration(options =>
275275
```
276276

277277
> [!NOTE]
278-
> Load balancing support is available if you use version **8.0.0-preview.3** or later of any of the following packages.
278+
> Load balancing support is available if you use version **8.0.0** or later of any of the following packages.
279279
> - `Microsoft.Extensions.Configuration.AzureAppConfiguration`
280280
> - `Microsoft.Azure.AppConfiguration.AspNetCore`
281281
> - `Microsoft.Azure.AppConfiguration.Functions.Worker`

articles/azure-app-configuration/howto-targetingfilter-aspnet-core.md

Lines changed: 14 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -199,68 +199,26 @@ In this section, you create a web application that allows users to sign in and u
199199
200200
## Enable targeting for the web application
201201
202-
The targeting filter evaluates a user's feature state based on the user's targeting context, which comprises the user ID and the groups the user belongs to. In this example, you use the signed-in user's email address as the user ID and the domain name of the email address as the group.
202+
A targeting context is required for feature evaluation with targeting. You can provide it as a parameter to the `featureManager.IsEnabledAsync` API explicitly. In ASP.NET Core, the targeting context can also be provided through the service collection as an ambient context by implementing the [ITargetingContextAccessor](./feature-management-dotnet-reference.md#itargetingcontextaccessor) interface.
203203
204-
1. Add an *ExampleTargetingContextAccessor.cs* file with the following code. You implement the `ITargetingContextAccessor` interface to provide the targeting context for the signed-in user of the current request.
204+
### Targeting Context Accessor
205205
206-
```csharp
207-
using Microsoft.FeatureManagement.FeatureFilters;
206+
To provide the targeting context, pass your implementation type of the `ITargetingContextAccessor` to the `WithTargeting<T>` method. If no type is provided, a default implementation is used, as shown in the following code snippet. The default targeting context accessor utilizes `HttpContext.User.Identity.Name` as `UserId` and `HttpContext.User.Claims` of type [`Role`](/dotnet/api/system.security.claims.claimtypes.role#system-security-claims-claimtypes-role) for `Groups`. You can reference the [DefaultHttpTargetingContextAccessor](https://github.com/microsoft/FeatureManagement-Dotnet/blob/main/src/Microsoft.FeatureManagement.AspNetCore/DefaultHttpTargetingContextAccessor.cs) to implement your own if customization is needed. To learn more about implementing the `ITargetingContextAccessor`, see the [feature reference for targeting](./feature-management-dotnet-reference.md#itargetingcontextaccessor).
208207
209-
namespace TestFeatureFlags
210-
{
211-
public class ExampleTargetingContextAccessor : ITargetingContextAccessor
212-
{
213-
private const string TargetingContextLookup = "ExampleTargetingContextAccessor.TargetingContext";
214-
private readonly IHttpContextAccessor _httpContextAccessor;
215-
216-
public ExampleTargetingContextAccessor(IHttpContextAccessor httpContextAccessor)
217-
{
218-
_httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
219-
}
220-
221-
public ValueTask<TargetingContext> GetContextAsync()
222-
{
223-
HttpContext httpContext = _httpContextAccessor.HttpContext;
224-
if (httpContext.Items.TryGetValue(TargetingContextLookup, out object value))
225-
{
226-
return new ValueTask<TargetingContext>((TargetingContext)value);
227-
}
228-
List<string> groups = new List<string>();
229-
if (httpContext.User.Identity.Name != null)
230-
{
231-
groups.Add(httpContext.User.Identity.Name.Split("@", StringSplitOptions.None)[1]);
232-
}
233-
TargetingContext targetingContext = new TargetingContext
234-
{
235-
UserId = httpContext.User.Identity.Name,
236-
Groups = groups
237-
};
238-
httpContext.Items[TargetingContextLookup] = targetingContext;
239-
return new ValueTask<TargetingContext>(targetingContext);
240-
}
241-
}
242-
}
243-
```
208+
``` C#
209+
// Existing code in Program.cs
210+
// ... ...
244211
245-
1. Open the *Program.cs* file and enable the targeting filter by calling the `WithTargeting` method. You pass in the type `ExampleTargetingContextAccessor` that the targeting filter will use to get the targeting context during feature flag evaluation. Add `HttpContextAccessor` to the service collection to allow `ExampleTargetingContextAccessor` to access the signed-in user information from the `HttpContext`.
212+
// Add feature management to the container of services
213+
builder.Services.AddFeatureManagement()
214+
.WithTargeting();
246215
247-
```csharp
248-
// Existing code in Program.cs
249-
// ... ...
250-
251-
// Add feature management to the container of services
252-
builder.Services.AddFeatureManagement()
253-
.WithTargeting<ExampleTargetingContextAccessor>();
216+
// The rest of existing code in Program.cs
217+
// ... ...
218+
```
254219

255-
// Add HttpContextAccessor to the container of services.
256-
builder.Services.AddHttpContextAccessor();
257-
258-
// The rest of existing code in Program.cs
259-
// ... ...
260-
```
261-
262-
> [!NOTE]
263-
> For Blazor applications, see [instructions](./faq.yml#how-to-enable-feature-management-in-blazor-applications-or-as-scoped-services-in--net-applications) for enabling feature management as scoped services.
220+
> [!NOTE]
221+
> For Blazor applications, see [instructions](./faq.yml#how-to-enable-feature-management-in-blazor-applications-or-as-scoped-services-in--net-applications) for enabling feature management as scoped services.
264222
265223
## Targeting filter in action
266224

@@ -280,10 +238,6 @@ The targeting filter evaluates a user's feature state based on the user's target
280238
281239
Now sign in as `[email protected]`, using the password you set when registering the account. The **Beta** item doesn't appear on the toolbar, because `[email protected]` is specified as an excluded user.
282240

283-
You can create more users with `@contoso.com` and `@contoso-xyz.com` email addresses to see the behavior of the group settings.
284-
285-
Users with `contoso-xyz.com` email addresses won't see the **Beta** item. While 50% of users with `@contoso.com` email addresses will see the **Beta** item, the other 50% won't see the **Beta** item.
286-
287241
## Next steps
288242

289243
To learn more about the feature filters, continue to the following documents.

articles/azure-app-configuration/quickstart-feature-flag-azure-functions-csharp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ This project will use [dependency injection in .NET Azure Functions](../azure-fu
134134
Add a constructor used to obtain instances of `_featureManagerSnapshot` and `IConfigurationRefresherProvider` through dependency injection. From the `IConfigurationRefresherProvider`, you can obtain the instance of `IConfigurationRefresher`.
135135

136136
```csharp
137-
private readonly IFeatureManagerSnapshot _featureManagerSnapshot;
137+
private readonly IVariantFeatureManagerSnapshot _featureManagerSnapshot;
138138
private readonly IConfigurationRefresher _configurationRefresher;
139139

140-
public Function1(IFeatureManagerSnapshot featureManagerSnapshot, IConfigurationRefresherProvider refresherProvider)
140+
public Function1(IVariantFeatureManagerSnapshot featureManagerSnapshot, IConfigurationRefresherProvider refresherProvider)
141141
{
142142
_featureManagerSnapshot = featureManagerSnapshot;
143143
_configurationRefresher = refresherProvider.Refreshers.First();

articles/azure-app-configuration/quickstart-feature-flag-dotnet-background-service.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,16 @@ Add a feature flag called *Beta* to the App Configuration store and leave **Labe
117117
using Microsoft.FeatureManagement;
118118
```
119119
120-
1. Update the constructor of the `Worker` service to obtain instances of `IConfigurationRefresher` and `IFeatureManager` through dependency injection.
120+
1. Update the constructor of the `Worker` service to obtain instances of `IConfigurationRefresher` and `IVariantFeatureManager` through dependency injection.
121121
122122
```csharp
123123
public class Worker : BackgroundService
124124
{
125125
private readonly ILogger<Worker> _logger;
126126
private readonly IConfigurationRefresher _refresher;
127-
private readonly IFeatureManager _featureManager;
127+
private readonly IVariantFeatureManager _featureManager;
128128
129-
public Worker(ILogger<Worker> logger, IConfigurationRefresher refresher, IFeatureManager featureManager)
129+
public Worker(ILogger<Worker> logger, IConfigurationRefresher refresher, IVariantFeatureManager featureManager)
130130
{
131131
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
132132
_refresher = refresher ?? throw new ArgumentNullException(nameof(refresher));

articles/azure-app-configuration/quickstart-feature-flag-dotnet.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ You can use Visual Studio to create a new console app project.
4040

4141
1. Start Visual Studio, and select **File** > **New** > **Project**.
4242

43-
1. In **Create a new project**, filter on the **Console** project type and select **Console App**. If you want to create a .NET Framework app, please select **Console App (.NET Framework)** instead. Click **Next**.
43+
1. In **Create a new project**, filter on the **Console** project type and select **Console App**. If you want to create a .NET Framework app, select **Console App (.NET Framework)** instead. Click **Next**.
4444

45-
1. In **Configure your new project**, enter a project name. If you are creating a .NET Framework app, please select **.NET Framework 4.7.2** or higher under **Framework**. Click **Create**.
45+
1. In **Configure your new project**, enter a project name. If you're creating a .NET Framework app, select **.NET Framework 4.7.2** or higher under **Framework**. Click **Create**.
4646

4747
## Use the feature flag
4848

@@ -77,7 +77,7 @@ You can use Visual Studio to create a new console app project.
7777
7878
IFeatureDefinitionProvider featureDefinitionProvider = new ConfigurationFeatureDefinitionProvider(configuration);
7979
80-
IFeatureManager featureManager = new FeatureManager(
80+
IVariantFeatureManager featureManager = new FeatureManager(
8181
featureDefinitionProvider,
8282
new FeatureManagementOptions());
8383
@@ -103,7 +103,7 @@ You can use Visual Studio to create a new console app project.
103103
104104
IFeatureDefinitionProvider featureDefinitionProvider = new ConfigurationFeatureDefinitionProvider(configuration);
105105
106-
IFeatureManager featureManager = new FeatureManager(
106+
IVariantFeatureManager featureManager = new FeatureManager(
107107
featureDefinitionProvider,
108108
new FeatureManagementOptions());
109109
@@ -130,7 +130,7 @@ You can use Visual Studio to create a new console app project.
130130
setx ConnectionString "<connection-string-of-your-app-configuration-store>"
131131
```
132132
133-
Restart the command prompt to allow the change to take effect. Print the value of the environment variable to validate that it's set properly.
133+
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.
134134
135135
### [PowerShell](#tab/powershell)
136136
2.25 KB
Loading

0 commit comments

Comments
 (0)