Skip to content
84 changes: 84 additions & 0 deletions releaseNotes/Microsoft.Featuremanagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,90 @@
# Microsoft.FeatureManagement.AspNetCore
[Source code ][source_code_web] | [Package (NuGet)][package_web] | [Samples][samples_web] | [Product documentation][docs]

## 4.0.0-preview2 - March 7, 2024
Comment thread
rossgrambo marked this conversation as resolved.

### Feature Service Injector
Comment thread
rossgrambo marked this conversation as resolved.
Outdated

Dependency injection can be wired up with a variant feature flag. Different implementations of a service interface can be considered as variant services. Using the newly provided `IVariantServiceProvider<TService>`, the appropriate service can be injected.
Comment thread
rossgrambo marked this conversation as resolved.
Outdated

To use it, a variant service needs to be declared

``` C#
services.AddFeatureManagement()
.WithVariantService<IAlgorithm>("ForecastAlgorithm");
```

The different options of the service need to extend a shared interface

``` C#
public class AlgorithmAlpha : IAlgorithm
{
...
}

public class AlgorithmBeta : IAlgorithm
{
...
}
```

And the appropriate variant flag needs to exist

```json
"ForecastAlgorithm": {
"Variants": [
{
"Name": "AlgorithmAlpha"
},
{
"Name": "AlgorithmBeta"
}
]
}
```

Lastly, the provider is ready to be used and grab the appropriate service for the variant.

``` C#
IVariantServiceProvider<IAlgorithm> algorithmServiceProvider;
...
IAlgorithm forecastAlgorithm = await algorithmServiceProvider.GetServiceAsync(cancellationToken);
```

The readme will be updated to fully describe the new functionality.
Comment thread
rossgrambo marked this conversation as resolved.
Outdated

### Telemetry & Targeting

This preview release includes some additional mechanisms to track targeting within telemetry. There's been some changes to the telemetry publisher fields, and a couple classes are now offered/have been updated: `TargetingTelemetryInitializer` in `Microsoft.FeatureManagement.Telemetry.AspNetCore` and `TargetingHttpContextMiddleware` in `Microsoft.FeatureManagement.Telemetry.AspNetCore`.
Comment thread
rossgrambo marked this conversation as resolved.
Outdated

These changes introduce the field `TargetingId`, which tracks the id used by TargetingFilters and Allocation. This allows telemetry to connect events by the target to the evaluation events for the target, rather than relying on built in app insights fields that may or may not exist in a project.
Comment thread
rossgrambo marked this conversation as resolved.
Outdated

Currently the classes need to be explicitly added:

``` C#
builder.Service.AddSingleton<ITelemetryInitializer, TargetingTelemetryInitializer>();

app.UseMiddleware<TargetingHttpContextMiddleware>();
```

### Additional Changes

#### BlazorServerApp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not part of the released packages.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These release notes are limited exclusively to the functionality of the released packages.

An example for Blazor has been added named `BlazorServerApp`. This app demonstrates how to handle FeatureMangement setup, use, and targeting context accessors in Blazor.

#### Schema

A schema file has been introduced to explicitly declare [the Feature Flag schema](https://github.com/microsoft/FeatureManagement-Dotnet/blob/release/v4/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json).
Comment thread
rossgrambo marked this conversation as resolved.
Outdated

#### Net8 build target

Net8 was added as a build target.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be presented as a feature - we added support for .NET 8.

(Reminder of the release notes guidelines - talk about the feature in customer perspective, not how we implement it.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to find the correct thing to say- seeing as the only change was adding it was a build target- which means we're less likely to break Net8, but there's no immediate customer benefit.

I went with:

Net8 support

Added support for Net8 applications by adding Net8 as a build target.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

microsoft/FeatureManagement-Dotnet#365
What this PR did was to have our test suites also build for .NET 8.0.

Maybe we should not mention this in the release note, since the user will not notice this change.


### Breaking Changes

There are no breaking changes in this release.

## 3.2.0 - February 29, 2024

### Enhancements
Expand Down