@softwareimaging/backstage-azure-config
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

Backstage Azure App Configuration Provider

A provider for Backstage that adds support for the Azure App Configuration service.

Backstage is a headless environment & feature flag library that isn't tied to any specific service or format. It's a React based library that focuses on being easy to use and simple to integrate with any (and multiple) feature providers.

Usage

If you haven't added Backstage to your project yet, install the main package.

npm i @softwareimaging/backstage --save

To get started with this provider, add it to your project also.

npm i @softwareimaging/backstage-azure-config --save

Additional conditions

const BackstageProvider = ({ children }) => {
  const providers = [
    BackstageAzureConfig(0, {
      connectionString,
      label: 'production', // environments, etc
      groups: ['customer-a'], // organisations, groups, tenants, etc.
      user: 'dc994182-d8d6-477e-a1bf-b7307c0bb051' /* to identify
      a single user, please don't use emails or names. */
    })
  ]

  return <Backstage providers={providers}>{children}</Backstage>
}

You can supply a user & an array of groups to the provider to be compared against in Azure App Configuration's "Targeting" feature filter.

If a flag is disabled, it will be false in Backstage regardless of the following additional conditions.

If the user string matches what's supplied in the filter then it will be turned on. This bypasses any group condition or rollout percentage.

As is stands this list of users is exposed to all clients. Ensure you use a anonymous, random value like a hash or an ID and not an email or name to ensure you don't leak personal information.

In Azure App Configuration, when you enable a Targeting filter you get a "rollout percentage" as both a default and for each specific group. 0 means off for everyone, 100 means on for everyone. If it's in the middle, that will be used as a probability when setting the flags on the client side.

In both cases, the results of the probability evaluation is saved to local storage to keep it sticky. This is designed for short term experiments like A/B testing or canary deployments, not for robust, reliable long-term uses.

If the groups provided match a group in Azure App Configuration, the rollout probability will be calculated and the result saved.

If you change the "rollout percentage", either default or in a group, the saved probability will be discarded and a new one will be calculated and saved.

Some features are not supported

Please note, currently both "Time window" and custom filters are not supported in Backstage and will throw an error at runtime.

Readme

Keywords

none

Package Sidebar

Install

npm i @softwareimaging/backstage-azure-config

Weekly Downloads

1

Version

1.3.2

License

MIT

Unpacked Size

32.9 kB

Total Files

14

Last publish

Collaborators

  • james-si