# @softwareimaging/backstage-azure-config

> A provider for [Backstage]() that adds support for the [Azure App Configuration]() service.

Latest version **1.3.2** (published 2023-07-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @softwareimaging/backstage-azure-config
pnpm add @softwareimaging/backstage-azure-config
yarn add @softwareimaging/backstage-azure-config
bun add @softwareimaging/backstage-azure-config
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.2 |
| Published | 2023-07-07 |
| First published | 2022-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 32.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | james-si |

## Links

- npm: https://www.npmjs.com/package/@softwareimaging/backstage-azure-config
- npm.io page: https://npm.io/package/@softwareimaging/backstage-azure-config

## Dependencies (2)

- [@azure/app-configuration](https://npm.io/package/@azure/app-configuration.md) ^1.3.1
- [@softwareimaging/backstage](https://npm.io/package/@softwareimaging/backstage.md) ^3.0.0

## Recent versions

- 1.3.2 (latest) — 2023-07-07
- 1.3.1 — 2022-10-13
- 1.3.0 — 2022-06-16
- 1.2.0 — 2022-03-05
- 1.0.0 — 2022-02-18

## README

# 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

```js
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.

---
_Source: https://npm.io/package/@softwareimaging/backstage-azure-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
