You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/feature-management-dotnet-reference.md
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,63 @@ A `requirement_type` of `All` changes the traversal. First, if there is no filte
140
140
141
141
In this example, `FeatureW` specifies a `requirement_type` of `All`, meaning all of its filters must evaluate to true for the feature to be enabled. In this case, the feature is enabled for 50% of users during the specified time window.
142
142
143
+
#### Handling multiple configuration sources
144
+
145
+
Starting with v4.3.0, you can opt in to custom merging for Microsoft schema feature flags (the `feature_management` section). When the same feature flag ID appears in multiple configuration sources, the built-in `ConfigurationFeatureDefinitionProvider` merges those definitions according to configuration provider registration order. If there's a conflict, the last feature flag definition wins. This behavior differs from .NET's default array index-based merging.
146
+
147
+
The following example demonstrates how to enable custom feature flag configuration merging through dependency injection.
You can also enable it when constructing the `ConfigurationFeatureDefinitionProvider`
164
+
165
+
```C#
166
+
varfeatureManager=newFeatureManager(
167
+
newConfigurationFeatureDefinitionProvider(
168
+
configuration,
169
+
newConfigurationFeatureDefinitionProviderOptions
170
+
{
171
+
CustomConfigurationMergingEnabled=true
172
+
}));
173
+
```
174
+
175
+
Example behavior:
176
+
177
+
```javascript
178
+
// appsettings.json
179
+
{
180
+
"feature_management": {
181
+
"feature_flags": [
182
+
{ "id":"FeatureA", "enabled":true },
183
+
{ "id":"FeatureB", "enabled":false }
184
+
]
185
+
}
186
+
}
187
+
188
+
// appsettings.prod.json (added later in ConfigurationBuilder)
189
+
{
190
+
"feature_management": {
191
+
"feature_flags": [
192
+
{ "id":"FeatureB", "enabled":true }
193
+
]
194
+
}
195
+
}
196
+
```
197
+
198
+
With custom merging enabled, `FeatureA` remains enabled and `FeatureB` resolves to enabled (last declaration wins). With default .NET merging (custom merging disabled), arrays are merged by index, which can yield unexpected results if sources don’t align by position.
199
+
143
200
### .NET Feature Management schema
144
201
145
202
In previous versions, the primary schema for the feature management library was the [`.NET feature management schema`](https://github.com/microsoft/FeatureManagement-Dotnet/blob/main/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json). Starting from v4.0.0, new features including variants and telemetry are not supported for the .NET feature management schema.
0 commit comments