Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking feature flags in client-side application #14705

Closed
ropez opened this issue Apr 4, 2021 · 6 comments
Closed

Checking feature flags in client-side application #14705

ropez opened this issue Apr 4, 2021 · 6 comments
Assignees
Labels
App Configuration Azure.ApplicationModel.Configuration Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@ropez
Copy link

ropez commented Apr 4, 2021

I'm trying to figure out how to use Feature flags in a front-end application (SPA). Specifically, an application build with Vue,js, but it would have been the same if the application was build for instance with React or Angular.

I find it difficult to understand how the @azure/app-configuration package is helpful for this scenario.

  • The package seems to have a lot of functionality that is not needed. I'm not interested in setting or editing any configuration values.
  • All the examples in the documentation seems to be focused on editing values. So for me, is seems like the package is meant for managing the application, not to be used in the application itself.
  • The package adds something like 120 KB to the application bundle, twice as much as Vue.js itself
  • The one thing I need to do, which is to check if a feature flag is enabled or not, is not shown in any of the examples. I found some examples in other places, but they include manually parsing JSON, and don't seem to take targeting percentages into account.

So my question is, how to I actually use a feature flag in my application. I'm looking for something like this:

if (featureFlag.isEnabled()) {
  showFeature();
}

I would also expect a feature flag management system to be able to track changes and update the application (e.g. using polling or websockets subscription etc).

Is there at all a javascript client that supports these use cases, or is it something that users are expected to implement themselves?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 4, 2021
@HarshaNalluru
Copy link
Member

Hey @ropez,

Thanks for reaching out.
Feature flag support in the SDK is currently under development.
#14342 PR adds the support you expect w.r.t feature flags.

We'll be releasing a new preview version 1.2.0-beta.1 version for @azure/app-configuration this week with the feature flag support as part of the new features.

The current estimate is that the new 1.2.0 version will be released for GA(General Availability) in the June-July timeframe.

@ropez
Copy link
Author

ropez commented Apr 5, 2021

Thanks for the reply, @HarshaNalluru

Unfortunately, looking through the PR that you've linked to, the functionality seems to be consistent with the points I made above. All the examples and test cases seems to be focused on editing feature flags, not using them in an application to toggle features. So I don't feel like my question was answered, if there is Javascript tools to support that use-case, or if it's something we would have to create for ourselves (basing our entire system on Azure components).

@ramya-rao-a ramya-rao-a added App Configuration Azure.ApplicationModel.Configuration Client This issue points to a problem in the data-plane of the library. labels Apr 5, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Apr 5, 2021
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Apr 5, 2021
@HarshaNalluru
Copy link
Member

That's good feedback @ropez. I'll check with the team and get back on the use cases.

@HarshaNalluru HarshaNalluru added this to the [2021] May milestone Apr 5, 2021
@HarshaNalluru
Copy link
Member

HarshaNalluru commented Apr 12, 2021

Hey @ropez,

I've created a PR that adds a sample react app with feature flags #14845.
Let me know if that helps and feel free to review the PR.

I would also expect a feature flag management system to be able to track changes and update the application (e.g. using polling or websockets subscription etc).
Is there at all a javascript client that supports these use cases, or is it something that users are expected to implement themselves?

Client doesn't offer such support, you'd have to implement yourself if your application requires so.

@HarshaNalluru
Copy link
Member

Some more information.. the recommendation from the service team for our users would be to use App Configuration on their server-side and let the service cache and pass feature-flags to the clients.

Azure App Configuration is currently tailored to provide configuration/feature flags for server-side applications. It is possible to retrieve configuration/feature flags from a client-side application however scalability can quickly become a problem.

Azure App Configuration has a request quota detailed here.

"20,000 per hour(Once the quota is exhausted, HTTP status code 429 will be returned for all requests until the end of the hour)"

ghost pushed a commit that referenced this issue Apr 28, 2021
## What does the app show?

This app shows how the feature flags can be used in a sample react app.
This sample is the JS/TS equivalent of the sample at https://docs.microsoft.com/en-us/azure/azure-app-configuration/quickstart-feature-flag-spring-boot.

## Prerequisites 

As listed in the readme, to run this app, the user has to create an App Config resource and add the suggested feature flags.

## Screengrab of the app
![image 35](https://user-images.githubusercontent.com/10452642/114456903-44660800-9b92-11eb-974b-e7eca1579749.png)

Issue #14705
@HarshaNalluru HarshaNalluru added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Apr 28, 2021
@ghost ghost removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Apr 28, 2021
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label May 5, 2021
@ghost
Copy link

ghost commented May 5, 2021

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@ropez ropez closed this as completed May 5, 2021
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this issue Jul 1, 2021
Remove WorkspaceConnectionDto and use WorkspaceConnection instead for PUT request (Azure#14705)

* Add Identity to createWorkpace example

* change for getTransitivePEUsages

* update

* prettier code

* add another new endpoint

* address comments

* change for getTransitivePEUsages

* update

* prettier code

* add another new endpoint

* address comments

* revert change on transitivePE and notebookKeys

* revert change on transitivePE and notebookKeys

* add new stable version 2021-01-01

* add ListNotebookAccessToken

* add primaryUserAssignedIdentity

* fix missing properties and apis

* fix one more missing property

* 202 status for start and stop CI

* make resync keys long runnin operation in version Jan2021

* resync keys 204

* update resync keys example

* Dont throw 204 for resync

* update resync keys

* Formatting

* revert Jan2021changes and add new version

* start apr2021 version for azure ml rp

* undo remove new line in jan2021

* use systemData definition in common

* removed old files

* fix small swagger bugs

* run prettier

* remove reference to sku

* update readme

* minimum agentCount should be 0

* add createdOn and ModifiedOn to compute properties

* add LoadBalancerType to aks compute

* add isNotebookInstanceCompute to virtualMachine

* add leafDomainLabel to SslConfiguration

* add overwriteExistingDomain to SslConfiguration

* add synapseSpark as supported compute-type

* update patch compute response to 202

* remove location from example responses

* Revert "remove location from example responses"

This reverts commit 048bf2551513afae842a9c4fbb5861aeddc6c33a.

* MachineLearningCompute_Update should have a 200 response

* sys data to use local def due to naming conflicts.

* Fix enum casing

* Fix operationId PR comment.

* Change opId in apr version

* remove 20210401 for easy review

* only change api version

* merge changes for 20210401 version

* Add x-ms-discriminator-value for Synapse spark

* camelcase loadbalancer properties

* add createdOn and Modified on to examples

* address AvoidAnonymousTypes error for SynapseSpark

* Minor fixes + new property

* Remove subscription state.

* fix swagger bug

* fix example

* fix more reported problems

* remove nullable flag for tags

* make containerRegistry nullable

* address comments

* fix example

Co-authored-by: Vinay Rajmal Soni <[email protected]>
Co-authored-by: Suba <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Josh Peterson <[email protected]>
Co-authored-by: Suba <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
App Configuration Azure.ApplicationModel.Configuration Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants