![](/img/trans.png)
[英]Azure Feature Manager UseFeatureFlags filter by label not working as expected .net Core
[英]Azure Feature Manager Feature Toggle To Evaluate Using Label During Runtime
Using feature toggles in Azure Feature Manager gives the option to configure a label when creating a feature, in .NET to use that label the only option I could find is to set the label during startup when configuring Azure App Configuration which can be done like:
config.AddAzureAppConfiguration(
options =>
{
options.Connect(settings.GetConnectionString("Config"))
.UseFeatureFlags(o =>
{
o.Label = "Test";
o.CacheExpirationInterval = TimeSpan.FromSeconds(1);
});
},
這種方法的問題是在運行期間我們無法更改 label,因為它是在啟動期間預先配置的。 問題是我們如何管理不同的標簽,假設我有 100 個標簽,我希望我的應用程序評估關於其 label 的功能切換,我無法找到實現這一點的方法。 為了評估功能切換,我們像這樣調用功能管理器await _featureManager.IsEnabledAsync(setting);
我會說你不能,這不是一件壞事。 標簽在那里,因此您可以將一個功能標志保存兩次,可能使用不同的值和過濾器。 例如:
或者
因此,您應該使用標簽為不同階段或不同地區或您可能擁有的任何其他用例的一個功能保存不同的值。 您不應該在正在運行的應用程序中的標簽之間切換。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.