Domain 4 β€” Module 2 of 5 40%
24 of 27 overall
Domain 4: Secure, monitor, and troubleshoot Azure solutions Free ⏱ ~11 min read

Azure App Configuration: Centralised Settings

Where non-secret configuration belongs. Feature flags, labels for environments, refresh intervals, Microsoft Entra access, and how App Configuration combines with Key Vault for production-grade config management.

What App Configuration is β€” and how it differs from Key Vault

Simple explanation

Azure App Configuration is the home for non-secret config. Things like the model name, the log level, the feature flags, the default temperature for the LLM. Stuff you change a lot, want to share between services, and don’t need to encrypt with HSMs.

Key Vault stores secrets; App Configuration stores everything else. Together they cover the full surface β€” the typical pattern is App Configuration with Key Vault references for the values that ARE secret.

Two killer features for AI-200:

  • Labels β€” the same key can have different values per environment (dev, staging, prod) using labels.
  • Feature flags β€” turn features on/off in production without a redeploy. Roll out to a percentage of users; turn off if something breaks.

Keys, values, labels

Key                              Label      Value
app:settings:LogLevel            (none)     Information
app:settings:LogLevel            staging    Debug
app:settings:LogLevel            prod       Warning
app:settings:ModelName           (none)     gpt-4o-mini
app:settings:ModelName           prod       gpt-4o
features:NewRagPipeline          (none)     {"enabled":false}
features:NewRagPipeline          prod       {"enabled":true}

A SDK reads with both key and label. The same code with different labels gets different config:

from azure.appconfiguration import AzureAppConfigurationClient
from azure.identity import DefaultAzureCredential

client = AzureAppConfigurationClient(
    base_url="https://roo-config.azconfig.io",
    credential=DefaultAzureCredential(),
)

setting = client.get_configuration_setting(
    key="app:settings:LogLevel",
    label="prod",
)
print(setting.value)   # "Warning"

Key Vault references β€” the integration

App Configuration values can reference Key Vault secrets. The value type is application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8:

{
  "uri": "https://roo-kv.vault.azure.net/secrets/OpenAIKey"
}

When the SDK reads this key it follows the URI to Key Vault (using the consumer’s identity, not App Configuration’s). So you get a single read surface for all config β€” secret and non-secret β€” without duplicating Key Vault references in every app’s settings.

# When the SDK loads config, Key Vault references resolve to actual secrets
config = client.list_configuration_settings(label_filter="prod")
for s in config:
    print(s.key, "->", s.value)   # secrets resolved to live values

Feature flags

Feature flags let you turn behaviour on or off without redeploying.

{
  "id": "NewRagPipeline",
  "description": "Use the new pgvector RAG pipeline",
  "enabled": false,
  "conditions": {
    "client_filters": [
      {
        "name": "Microsoft.Targeting",
        "parameters": {
          "Audience": {
            "Users": ["alpha@contoso.com"],
            "Groups": [{"Name": "InternalTesters", "RolloutPercentage": 100}],
            "DefaultRolloutPercentage": 5
          }
        }
      }
    ]
  }
}

Three targeting filters built in:

FilterWhat it does
TargetingSpecific users, groups, or rollout percentages
TimeWindowEnable between two dates / times
PercentageRandom % of traffic β€” A/B test gate
from featuremanagement import FeatureManager

manager = FeatureManager(...)
if await manager.is_enabled("NewRagPipeline", user_context):
    use_new_pipeline()
else:
    use_old_pipeline()
Real-world example: Mira's gradual rollout

Mira launches a new vision model. Strategy:

  1. Feature flag EnableNewVisionModel set to 5% rollout in production
  2. Watch error rate, latency, accuracy in App Insights for 24 hours
  3. Bump to 25%, monitor 24 hours
  4. 50%, 100%
  5. If anything goes wrong at any stage, set the flag to 0% β€” instant kill switch, no redeploy

The feature flag value lives in App Configuration; the worker code is unchanged across the rollout.

Snapshots β€” point-in-time config

App Configuration supports snapshots β€” frozen, named copies of a label’s config at a moment in time. Useful for:

  • Pinning a deployment to a specific config version
  • Auditing what production was configured to on a particular date
  • Promoting config from dev to prod atomically (snapshot the dev label, copy as a prod label)

Authentication and authorisation

ModeUse
Connection stringQuick start; legacy
Microsoft Entra RBACRecommended β€” App Configuration Data Reader for read-only consumers
az role assignment create \
  --assignee $PRINCIPAL_ID \
  --role "App Configuration Data Reader" \
  --scope $(az appconfig show -n roo-config --query id -o tsv)

Built-in roles you’ll see:

RolePermissions
App Configuration Data ReaderRead keys, values, labels, feature flags
App Configuration Data OwnerRead + write
App Configuration Reader (control plane)Manage the resource itself

Refresh strategies

App Configuration provides three refresh patterns in SDKs:

PatternHowUse for
Automatic refreshSDK polls a sentinel key; on change, refreshes configMost apps β€” sentinel key changes whenever any config does
Push refresh via Event GridEvent Grid fires Microsoft.AppConfiguration.KeyValueModified; your app subscribes and refreshesLower-latency invalidation for critical settings
Manual refreshApp calls refresh() on the configuration provider on demandCustom rollouts

Polling intervals are configurable; default is 30 seconds for most SDKs. Don’t poll too aggressively β€” it costs requests and barely helps.

When NOT to use App Configuration

Some configuration genuinely belongs at app-level:

TypeWhere it belongs
Connection strings to databasesApp Configuration with Key Vault references for the password
API keysKey Vault, referenced from App Configuration
Feature flagsApp Configuration
Per-environment URLs (e.g., OpenAI deployment name)App Configuration
Local-only paths or build-time constantsApp Settings or env vars

Key terms

Question

What's the difference between Azure App Configuration and Key Vault?

Click or press Enter to reveal answer

Answer

App Configuration stores non-secret config (keys, values, feature flags, labels). Key Vault stores secrets, keys, certs. They work together: App Configuration values can reference Key Vault secrets, giving you a single read surface for all config.

Click to flip back

Question

What are labels in App Configuration?

Click or press Enter to reveal answer

Answer

Optional tags on configuration keys (e.g., `dev`, `staging`, `prod`). The same key can have different values per label. SDKs read with a label filter, so the same code in different environments gets the right config without code changes.

Click to flip back

Question

What are feature flags, and why do they need a separate service?

Click or press Enter to reveal answer

Answer

Boolean toggles that gate code paths at runtime. Storing them in a service like App Configuration lets you change the flag value in production without a redeploy β€” useful for gradual rollouts, A/B tests, and instant kill switches when something breaks.

Click to flip back

Question

How does App Configuration's Key Vault reference work?

Click or press Enter to reveal answer

Answer

A configuration value of content type `keyvaultref+json` contains a URI pointing to a Key Vault secret. When an SDK reads it, the consuming app's identity follows the URI to Key Vault and gets the actual secret value. Lets all config (secret and non-secret) come from one place.

Click to flip back

Question

What is the App Configuration sentinel key pattern?

Click or press Enter to reveal answer

Answer

A specific 'sentinel' key whose value the SDK polls on a schedule. When the sentinel changes (manually bumped on every config change), the SDK refreshes its full configuration. Cheap signal for 'something changed; come pick up the latest'.

Click to flip back

Knowledge check

Knowledge Check

Theo's clinical assistant has different log levels in dev (`Debug`), staging (`Information`), and prod (`Warning`). The team wants one config store; the same code reads the right value in each environment. Which App Configuration feature fits?

Knowledge Check

Mira wants the OPENAI_API_KEY to be retrieved from Key Vault, but referenced through her single App Configuration store like all the other config. What's the right pattern?

Knowledge Check

Lin wants to roll out a new pgvector pipeline to 5% of users in production, then ramp to 25%, 50%, 100% over a week. He must be able to revert instantly if it breaks. What feature should he use?