简体   繁体   English

使用 Azure 功能管理器与常规配置值“true”和“false”相比有什么好处

[英]What is the benefit of using the Azure Feature Manager vs regular configuration value of "true" and "false"

From what I've seen here if I have an Azure App Config set up and want to have a feature flag in it, in order to read its value or take advantage of it I must:从我在这里看到的情况来看,如果我设置了 Azure App Config 并希望其中有一个功能标志,为了读取它的值或利用它,我必须:

  1. Install a nuget, separate from the Microsoft.Extensions.Configuration one I already need for App Config安装一个 nuget,与我已经需要的 App Config 的 Microsoft.Extensions.Configuration 分开
  2. Add "UseFeatureFlags" in "CreateHostBuilder"在“CreateHostBuilder”中添加“UseFeatureFlags”
  3. Register the feature management in startup services在启动服务中注册功能管理
  4. Have an enum, designed specifically for each flag有一个枚举,专门为每个标志设计
  5. Register the feature manager in the "_ViewImports"在“_ViewImports”中注册功能管理器

And I don't see what benefit ALL THAT gives me over having a standard config value with wither "true" or "false" and skip all the previous steps and just go "if (featureValue)".而且我看不出 ALL THAT 给我带来什么好处,而不是让标准配置值带有“true”或“false”并跳过所有前面的步骤,而只是 go“if (featureValue)”。

So, what is the benefit I am not aware of that is worth going through all that trouble?那么,我不知道有什么好处值得经历所有这些麻烦呢?

The key feature is probably the use of conditional feature flags, https://learn.microsoft.com/en-us/azure/azure-app-configuration/howto-feature-filters-as.net-core , which are considerably more complex than just storing a boolean in your configuration.关键功能可能是使用条件功能标志https://learn.microsoft.com/en-us/azure/azure-app-configuration/howto-feature-filters-as.net-core ,这要多得多比仅在您的配置中存储 boolean 更复杂。

Using a library that supports both consistently is then a far better idea.使用一个始终支持这两者的库是一个更好的主意。

However, if you're only ever planning to use static feature flags, you may consider it more effort than it's worth.但是,如果您只打算使用 static 功能标志,您可能会认为付出的努力超过了它的价值。

In short here are some of the pros:简而言之,这里有一些优点:

  • a centralized location to manage feature flags管理功能标志的集中位置
  • labeling options标签选项
  • feature filters特征过滤器

A Targeting filter is a built-in filter which allows dynamic enabling or disabling of features for specific users or groups.目标筛选器是一种内置筛选器,允许动态启用或禁用特定用户或组的功能。 For example, you can use a targeting filter to enable a feature for only a specific user during a demo.例如,您可以使用定位过滤器在演示期间仅为特定用户启用功能。 You could also use it to progressively roll out new features to users in custom groups or "rings", or to set a default rollout percentage to release features to all users.您还可以使用它逐步向自定义组或“环”中的用户推出新功能,或者设置默认推出百分比以向所有用户发布功能。

Next to this, feature management helps developers address the following problems:除此之外,功能管理还可以帮助开发人员解决以下问题:

  • Code branch management : Use feature flags to wrap new application functionality currently under development.代码分支管理:使用功能标志来包装当前正在开发的新应用程序功能。 Such functionality is "hidden" by default.默认情况下,此类功能是“隐藏”的。 You can safely ship the feature, even though it's unfinished, and it will stay dormant in production.您可以安全地发布该功能,即使它尚未完成,并且它将在生产中保持休眠状态。 Using this approach, called dark deployment, you can release all your code at the end of each development cycle.使用这种称为暗部署的方法,您可以在每个开发周期结束时发布所有代码。 You no longer need to maintain code branches across multiple development cycles because a given feature requires more than one cycle to complete.您不再需要跨多个开发周期维护代码分支,因为给定的功能需要多个周期才能完成。
  • Test in production : Use feature flags to grant early access to new functionality in production.在生产中测试:使用功能标志来授予对生产中新功能的早期访问权限。 For example, you can limit access to team members or to internal beta testers.例如,您可以限制团队成员或内部 Beta 测试人员的访问权限。 These users will experience the full-fidelity production experience instead of a simulated or partial experience in a test environment.这些用户将体验到完全逼真的生产体验,而不是测试环境中的模拟或部分体验。
  • Flighting : Use feature flags to incrementally roll out new functionality to end users. Flighting :使用功能标志逐步向最终用户推出新功能。 You can target a small percentage of your user population first and increase that percentage gradually over time.您可以首先定位一小部分用户,然后随着时间的推移逐渐增加该百分比。
  • Instant kill switch : Feature flags provide an inherent safety.net for releasing new functionality. Instant kill switch :功能标志为发布新功能提供了一个内在的 safety.net。 You can turn application features on and off without redeploying any code.您可以在不重新部署任何代码的情况下打开和关闭应用程序功能。 If necessary, you can quickly disable a feature without rebuilding and redeploying your application.如有必要,您可以快速禁用某个功能,而无需重建和重新部署您的应用程序。
  • Selective activation : Use feature flags to segment your users and deliver a specific set of features to each group.选择性激活:使用功能标志来细分您的用户并向每个组提供一组特定的功能。 You may have a feature that works only on a certain web browser.您可能拥有仅适用于特定 web 浏览器的功能。 You can define a feature flag so that only users of that browser can see and use the feature.您可以定义一个功能标志,以便只有该浏览器的用户才能看到和使用该功能。 With this approach, you can easily expand the supported browser list later without having to make any code changes.使用这种方法,您可以在以后轻松扩展支持的浏览器列表,而无需进行任何代码更改。

Source: Feature management overview资料来源: 功能管理概述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 Spring 引导获取具有特定 label 的 Azure 应用程序配置功能标志的值? - How to get the value of Azure App Configuration Feature Flag with specific label from Spring boot? 使用 RWMutex 代替 Mutex 有什么好处? - What is the benefit of using RWMutex instead of Mutex? 使用 firebase 数据库在 ReactJs 中的完整按钮上切换真/假 state - Toggle true/false state on complete button in ReactJs using firebase database Azure Microsoft.FeatureManagement.FeatureManager 未检索到具有 Label 的应用程序配置功能标志 - Azure App Configuration Feature Flag with Label is not retrieved by Microsoft.FeatureManagement.FeatureManager 如何在 Flutter 中用 boolean 值(真假)对来自 firebase 的数据进行排序? - How to sort data from firebase with boolean value (true and false) in Flutter? Azure 服务总线功能 - Azure Service Bus Feature Azure 外部端点配置 - Azure External Endpoint Configuration pubsub <-> 使用 protobuf 的 bigquery:bool 正在转换为 null 或 true,而不是 false 或 true - pubsub <-> bigquery with protobuf: bool is getting converted to null or true, not false or true 在 Azure 存储上,CanGenerateSasUri 始终为 false - On Azure Storage, CanGenerateSasUri is always false 使用 Azure CLI 获取 Azure 应用程序网关的“principalId”值 - Using Azure CLI Get the 'principalId' value of an Azure Application Gateway
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM