Feature flags with App Configuration
In this task you'll turn a feature on for a percentage of users.
A feature flag lets code ship switched off; you turn it on separately. Azure App Configuration stores flags; filters such as Microsoft.Percentage or targeting turn them on for a slice of users.
Apps should read it with a managed identity (App Configuration Data Reader). In Cloud Shell, leave out --auth-mode login: its built-in identity can't get App Configuration data tokens, so the CLI uses the store's keys instead.
Example. SS Kaiser's new checkout went to 10% of shoppers through a flag; when an error appeared, the product owner switched it off in seconds without a deployment.
Before you start
You need: An App Configuration store and a data role. Time: 15 minutes.
Where to look
- Home
- App Configuration
- (store)
- Operations
- Feature manager
Steps
az appconfig feature set -n <store> --feature NewCheckout --label prod.az appconfig feature filter add ... --filter-name Microsoft.Percentage --filter-parameters Value=10.az appconfig feature enable ....Repeat with--label testso testers get their own setting.
Commands
az appconfig feature set -n <store> --feature NewCheckout --label prod --yes
az appconfig feature filter add -n <store> --feature NewCheckout --label prod --filter-name Microsoft.Percentage --filter-parameters Value=10 --yes
az appconfig feature enable -n <store> --feature NewCheckout --label prod --yes
Watch out for
- Cost
- The Free tier is free (one per subscription).
- Security
- Flags can expose unfinished features: keep them off in production until reviewed.
- Common mistakes
- Never removing old flags, so the code fills up with dead branches.
Clean up
az appconfig feature delete, or delete the store.
Words to know
- Feature flag
- An on or off switch for a feature, read by the app.
- Filter
- A rule that decides who gets a flag.
Tick off each step and track your progress in the guide.
Open this task in DevOps, Hands On