Releases: microsoft/FeatureManagement-Dotnet
3.5.0
Microsoft.FeatureManagement Updates
The packages associated with this release are
Microsoft.FeatureManagement
- No changes in this release.
Microsoft.FeatureManagement.AspNetCore
- Updated
Microsoft.FeatureManagement
reference to3.5.0
.
Enhancements
- Introduced an overloaded extension method
WithTargeting()
for ASP.NET Core applications. It registers a defaultITargetingContextAccessor
that constructs user context based on the authenticated user of a request. #466
4.0.0-preview4
Microsoft.FeatureManagement Updates
The packages associated with this release are
- Microsoft.FeatureManagement 4.0.0-preview4
- Microsoft.FeatureManagement.AspNetCore 4.0.0-preview4
- Microsoft.FeatureManagement.Telemetry.ApplicationInsights 4.0.0-preview4
Microsoft.FeatureManagement
Enhancements
- The feature flag telemetry pipeline is now integrated with .NET
Acitivity
instrumentation. Feature manager now has anAcitvitySource
called "Microsoft.FeatureManagement". If telemetry is enabled for a feature flag, whenever the feature flag is evaluated, feature manager will start anActivity
and add anActivityEvent
with tags containing feature evaluation information. #455
Breaking Changes
-
If you were using earlier preview versions of this package and configuration files to define variant feature flags, they are no longer supported in the .NET Feature Management schema. Instead, please use the Microsoft Feature Management schema to define variant feature flags. #421.
-
AddTelemetryPublisher
API andITelemetryPublisher
interface were removed. The feature flag telemetry pipeline is now integrated with .NETAcitivity
instrumentation. #455
Microsoft.FeatureManagement.AspNetCore
- Updated
Microsoft.FeatureManagement
reference to4.0.0-preview4
.
Microsoft.FeatureManagement.Telemetry.ApplicationInsights
- Updated
Microsoft.FeatureManagement
reference to4.0.0-preview4
.
Enhancements
-
Introduced a new API
AddApplicationInsightsTelemetryPublisher
to register a feature flag telemetry publisher for Application Insights. #455builder.Services.AddFeatureManagement() .WithTargeting() .AddApplicationInsightsTelemetryPublisher();
Breaking Changes
-
The
TargetingTelemetryInitializer
type has been moved to this package from the now-deprecatedMicrosoft.FeatureManagement.Telemetry.ApplicationInsights.AspNetCore
package. This change simplifies the utilization of feature flag telemetry. -
The type
ApplicationInsightsTelemetryPublisher
has been removed as its functionality has been replaced with the new APIAddApplicationInsightsTelemetryPublisher
for publishing feature flag telemetry to Application Insights. #455
3.4.0
Microsoft.FeatureManagement Updates
The packages associated with this release are
Microsoft.FeatureManagement
Enhancements
- All public classes no longer use init-only setters, ensuring compatibility with application using C# 7 or earlier. #450
Microsoft.FeatureManagement.AspNetCore
- Updated
Microsoft.FeatureManagement
reference to3.4.0
.
3.3.1
Microsoft.FeatureManagement Updates
The packages associated with this release are
Microsoft.FeatureManagement
Bug fixes
- Fixed a bug that
TimeWindowFilter
would be registered repeatedly when callingAddFeatureFilter<TimeWindowFilter>
after the call ofAddFeatureManagement()
. #447
Microsoft.FeatureManagement.AspNetCore
- Updated
Microsoft.FeatureManagement
reference to3.3.1
.
3.3.0
Microsoft.FeatureManagement Updates
The packages associated with this release are
Microsoft.FeatureManagement
Enhancements
- Added a
Recurrence
option to theTimeWindow
filter to support recurring time window. This enables scenarios where a feature flag is activated based on a recurrence pattern, such as every day after 5 PM or every Friday. See more details here. (#266) - A
LoggerFactory
is no longer required when constructing built-in filters. (#386)
Bug fixes
- Fixed a possible null-reference exception when enumerating
GetFeatureNamesAsync
. (#438)
Microsoft.FeatureManagement.AspNetCore
- Updated
Microsoft.FeatureManagement
reference to3.3.0
.
4.0.0-preview3
Microsoft.FeatureManagement Updates
The packages associated with this release are
- Microsoft.FeatureManagement 4.0.0-preview3
- Microsoft.FeatureManagement.AspNetCore 4.0.0-preview3
- Microsoft.FeatureManagement.Telemetry.ApplicationInsights 4.0.0-preview3
- Microsoft.FeatureManagement.Telemetry.ApplicationInsights.AspNetCore 4.0.0-preview3
Microsoft.FeatureManagement
Enhancements
- Added support for variant feature flags defined using Microsoft Feature Management schema. Variants and telemetry can be declared using Microsoft Feature Flag schema v2. The Microsoft Feature Management schema is designed to be language agnostic, enabling you to apply a consistent feature management configuration across Microsoft feature management libraries of different programming languages.
Microsoft.FeatureManagement.AspNetCore
- Updated
Microsoft.FeatureManagement
reference to4.0.0-preview3
.
Microsoft.FeatureManagement.Telemetry.ApplicationInsights
Breaking Changes
-
Updated the namespace for
ApplicationInsightsTelemetryPublisher
toMicrosoft.FeatureManagement.Telemetry
. In the future, developers using any of our offered telemetry publishers will no longer need to specify the service specific namespaces likeusing Microsoft.FeatureManagement.Telemetry.ApplicationInsights
. -
Updated the namespace for
TrackEvent
extension method ofTelemetryClient
toMicrosoft.ApplicationInsights
. The previous directiveusing Microsoft.FeatureManagement.Telemetry.ApplicationInsights
is no longer required when calling theTrackEvent
method.
Microsoft.FeatureManagement.Telemetry.ApplicationInsights.AspNetCore
- Updated
Microsoft.FeatureManagement
reference to4.0.0-preview3
.
4.0.0-preview2
Microsoft.FeatureManagement Updates
The packages associated with this release are
- Microsoft.FeatureManagement 4.0.0-preview2
- Microsoft.FeatureManagement.AspNetCore 4.0.0-preview2
- Microsoft.FeatureManagement.Telemetry.ApplicationInsights 4.0.0-preview2
- Microsoft.FeatureManagement.Telemetry.ApplicationInsights.AspNetCore 4.0.0-preview2
Microsoft.FeatureManagement
Enhancements
- Added support for variant feature flag-based service provider in dependency injection. It allows different service implementations to be injected automatically for different targeted audiences based on their variant assignment. (#39). See more details here.
- Added a
TargetingContext
property to theEvaluationEvent
. This allows feature evaluation events to accurately represent what the targeting context was at the time of feature evaluation. (#409)
Microsoft.FeatureManagement.AspNetCore
Enhancements
- Introduced a new ASP.NET Core middleware called
TargetingHttpContextMiddleware
. It makes targeting information available fromHttpContext
on each request. (#409) - Added support for .NET 8 target framework. (#364)
Microsoft.FeatureManagement.Telemetry.ApplicationInsights
Enhancements
- Added a
TargetingId
property to the feature evaluation events sent to Application Insights. TheTargetingId
is the identifier of a targeted user during feature evaluation. This new property allows you to correlate feature evaluation events with other telemetry data your application sends to Application Insights, as long as they share the sameTargetingId
. (#409)
Microsoft.FeatureManagement.Telemetry.ApplicationInsights.AspNetCore
Enhancements
- Introduced a telemetry initializer named
TargetingTelemetryInitializer
. It automatically adds targeting information to telemetry data your application sends to Application Insights. This can be used to correlate your telemetry data with feature evaluation events based on the targeting information during your telemetry analysis. (#409)
3.2.0
Microsoft.FeatureManagement Updates
The packages associated with this release are
Enhancements
- Added support for feature flags defined using Microsoft Feature Management schema
4.0.0-preview
Microsoft.FeatureManagement Updates
The packages associated with this release are
- Microsoft.FeatureManagement 4.0.0-preview
- Microsoft.FeatureManagement.AspNetCore 4.0.0-preview
- Microsoft.FeatureManagement.Telemetry.ApplicationInsights 4.0.0-preview
Variants
Variants are a tool that can be used to surface different variations of a feature to different segments of an audience. Previously, this library only worked with flags. The flags were limited to boolean values, as they are either enabled or disabled. Variants have dynamic values. They can be string, int, a complex object, or a reference to a ConfigurationSection.
//
// Modify view based off multiple possible variants
Variant variant = await featureManager.GetVariantAsync(MyFeatureFlags.BackgroundUrl);
model.BackgroundUrl = variant.Configuration.Value;
return View(model);
Variants are defined within a Feature, under a new section named "Variants". Variants are assigned by allocation, defined in a new section named "Allocation".
"BackgroundUrl": {
"Variants": [
{
"Name": "GetStarted",
"ConfigurationValue": "https://learn.microsoft.com/en-us/media/illustrations/biztalk-get-started-get-started.svg"
},
{
"Name": "InstallConfigure",
"ConfigurationValue": "https://learn.microsoft.com/en-us/media/illustrations/biztalk-host-integration-install-configure.svg"
}
],
"Allocation": {
// Defines Users, Groups, or Percentiles for variant assignment
}
// Filters and other Feature fields
}
For more details on Variants, see here.
Telemetry
The feature management library now offers the ability to emit events containing information about a feature evaluation. This can be used to ensure a flag is running as expected, or to see which users were given which features and why they were given the feature. To enable this functionality, two things need to be done:
The flag needs to explicitly enable telemetry in its definition.
"MyFlag": {
"Telemetry": {
"Enabled": true
}
}
And a telemetry publisher needs to be registered. Custom publishers can be defined, but for Application Insights one is already available in the Microsoft.FeatureManagement.Telemetry.ApplicationInsights
package. Publishers can be added with a single line.
builder.services
.AddFeatureManagement()
.AddTelemetryPublisher<ApplicationInsightsTelemetryPublisher>();
An example is available to demonstrate how to use the new Telemetry in an ASP.NET application. See the example in the examples folder.
For more details on Telemetry, see here.
Additional Changes
IVariantFeatureManager
IVariantFeatureManager
has been added as the successor of the existing IFeatureManager
. It continues to offer the functions of IFeatureManager
, but offers the new GetVariantAsync
methods as well.
Cancellation Tokens
IVariantFeatureManager
incorporates cancellation tokens into the methods of IFeatureManager
. For existing apps to take advantage of cancellation tokens, use the IVariantFeatureManager
interface instead and adjust calls to IsEnabledAsync
or GetFeatureNamesAsync
to include a CancellationToken
.
Status field
Status is a new optional field on a Feature that controls how a flag's enabled state is evaluated. Flags can set this field to Disabled
. This will cause the flag to always act disabled, while the rest of the defined schema remains intact. See here.
Breaking Changes
There are no breaking changes in this release.
3.1.1
Microsoft.FeatureManagement Updates
The packages associated with this release are
Bug fix
- Fixed a bug where feature manager will fail to add cache entry if the shared memory cache sets
SizeLimit
. (#325)