AZ

azure-appconfiguration-py

A Python SDK for centralized management of application settings, feature flags, and dynamic configuration in Azure.

Install

mkdir -p .claude/skills/azure-appconfiguration-py && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4658" && unzip -o skill.zip -d .claude/skills/azure-appconfiguration-py && rm skill.zip

Installs to .claude/skills/azure-appconfiguration-py

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Azure App Configuration SDK for Python. Use for centralized configuration management, feature flags, and dynamic settings. Triggers: "azure-appconfiguration", "AzureAppConfigurationClient", "feature flags", "configuration", "key-value settings".
245 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Fetch and manage application settings
  • Implement feature flag logic
  • Create and list configuration snapshots
  • Set settings to read-only
  • Perform async configuration operations

How it works

The SDK uses a client to interact with Azure App Configuration, supporting both sync and async patterns, and requires context managers for resource cleanup.

Inputs & outputs

You give it
Configuration key or label
You get back
Configuration setting object or value

When to use azure-appconfiguration-py

  • Update application settings
  • Implement feature flag logic
  • Manage dynamic configuration keys

About this skill

Azure App Configuration SDK for Python

Centralized configuration management with feature flags and dynamic settings.

Installation

pip install azure-appconfiguration

Environment Variables

AZURE_APPCONFIGURATION_ENDPOINT=https://<name>.azconfig.io  # Required for Entra ID auth
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production

Authentication & Lifecycle

🔑 Two rules apply to every code sample below:

  1. Prefer DefaultAzureCredential. It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation.
    • Local dev: DefaultAzureCredential works as-is.
    • Production: set AZURE_TOKEN_CREDENTIALS=prod (or AZURE_TOKEN_CREDENTIALS=<specific_credential>) to constrain the credential chain to production-safe credentials.
  2. Wrap every client in a context manager so HTTP transports, sockets, and token caches are released deterministically:
    • Sync: with <Client>(...) as client:
    • Async: async with <Client>(...) as client: and async with DefaultAzureCredential() as credential: (from azure.identity.aio)

Snippets may abbreviate this setup, but production code should always follow both rules.

import os
from azure.appconfiguration import AzureAppConfigurationClient
from azure.identity import DefaultAzureCredential, ManagedIdentityCredential

# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
credential = DefaultAzureCredential(require_envvar=True)
# Or use a specific credential directly in production:
# See https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python#credential-classes
# credential = ManagedIdentityCredential()

with AzureAppConfigurationClient(
    base_url=os.environ["AZURE_APPCONFIGURATION_ENDPOINT"],
    credential=credential
) as client:
    # Use client here (see following sections for operations)
    ...

Configuration Settings

Get Setting

setting = client.get_configuration_setting(key="app:settings:message")
print(f"{setting.key} = {setting.value}")

Get with Label

# Labels allow environment-specific values
setting = client.get_configuration_setting(
    key="app:settings:message",
    label="production"
)

Set Setting

from azure.appconfiguration import ConfigurationSetting

setting = ConfigurationSetting(
    key="app:settings:message",
    value="Hello, World!",
    label="development",
    content_type="text/plain",
    tags={"environment": "dev"}
)

client.set_configuration_setting(setting)

Delete Setting

client.delete_configuration_setting(
    key="app:settings:message",
    label="development"
)

List Settings

All Settings

settings = client.list_configuration_settings()
for setting in settings:
    print(f"{setting.key} [{setting.label}] = {setting.value}")

Filter by Key Prefix

settings = client.list_configuration_settings(
    key_filter="app:settings:*"
)

Filter by Label

settings = client.list_configuration_settings(
    label_filter="production"
)

Feature Flags

Set Feature Flag

from azure.appconfiguration import ConfigurationSetting
import json

feature_flag = ConfigurationSetting(
    key=".appconfig.featureflag/beta-feature",
    value=json.dumps({
        "id": "beta-feature",
        "enabled": True,
        "conditions": {
            "client_filters": []
        }
    }),
    content_type="application/vnd.microsoft.appconfig.ff+json;charset=utf-8"
)

client.set_configuration_setting(feature_flag)

Get Feature Flag

setting = client.get_configuration_setting(
    key=".appconfig.featureflag/beta-feature"
)
flag_data = json.loads(setting.value)
print(f"Feature enabled: {flag_data['enabled']}")

List Feature Flags

flags = client.list_configuration_settings(
    key_filter=".appconfig.featureflag/*"
)
for flag in flags:
    data = json.loads(flag.value)
    print(f"{data['id']}: {'enabled' if data['enabled'] else 'disabled'}")

Read-Only Settings

# Make setting read-only
client.set_read_only(
    configuration_setting=setting,
    read_only=True
)

# Remove read-only
client.set_read_only(
    configuration_setting=setting,
    read_only=False
)

Snapshots

Create Snapshot

from azure.appconfiguration import ConfigurationSnapshot, ConfigurationSettingFilter

snapshot = ConfigurationSnapshot(
    name="v1-snapshot",
    filters=[
        ConfigurationSettingFilter(key="app:*", label="production")
    ]
)

created = client.begin_create_snapshot(
    name="v1-snapshot",
    snapshot=snapshot
).result()

List Snapshot Settings

settings = client.list_configuration_settings(
    snapshot_name="v1-snapshot"
)

Async Client

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

async def main():
    async with DefaultAzureCredential() as credential:
        async with AzureAppConfigurationClient(
            base_url=endpoint,
            credential=credential
        ) as client:
            setting = await client.get_configuration_setting(key="app:message")
            print(setting.value)

Client Operations

OperationDescription
get_configuration_settingGet single setting
set_configuration_settingCreate or update setting
delete_configuration_settingDelete setting
list_configuration_settingsList with filters
set_read_onlyLock/unlock setting
begin_create_snapshotCreate point-in-time snapshot
list_snapshotsList all snapshots

Best Practices

  1. Pick sync OR async and stay consistent. Do not mix azure.xxx sync clients with azure.xxx.aio async clients in the same call path. Choose one mode per module.
  2. Always use context managers for clients and async credentials. Wrap every client in with Client(...) as client: (sync) or async with Client(...) as client: (async). For async DefaultAzureCredential from azure.identity.aio, also use async with credential: so tokens and transports are cleaned up.
  3. Use labels for environment separation (dev, staging, prod)
  4. Use key prefixes for logical grouping (app:database:, app:cache:)
  5. Make production settings read-only to prevent accidental changes
  6. Create snapshots before deployments for rollback capability
  7. Use Entra ID instead of connection strings in production
  8. Refresh settings periodically in long-running applications
  9. Use feature flags for gradual rollouts and A/B testing

Reference Files

FileContents
references/capabilities.mdAdditional non-hero capabilities, operation-group coverage, and production checklists.
references/non-hero-scenarios.mdDedicated non-hero examples for secondary/advanced scenarios.

When not to use it

  • Non-Python environments
  • Applications not using Azure App Configuration

Prerequisites

azure-appconfiguration packageAZURE_APPCONFIGURATION_ENDPOINT environment variable

Limitations

  • Do not mix sync and async clients in the same call path

How it compares

It provides a programmatic interface for dynamic configuration updates compared to static environment variables or local files.

Compared to similar skills

azure-appconfiguration-py side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
azure-appconfiguration-py (this skill)129dReviewIntermediate
fastapi-templates5202moNo flagsIntermediate
fastapi-pro794moNo flagsAdvanced
telegram-bot-builder1066moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by microsoft

View all by microsoft

You might also like

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

5201,086

fastapi-pro

sickn33

Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.

79181

telegram-bot-builder

davila7

Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.

106130

stripe-integration

wshobson

Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.

48165

billing-automation

wshobson

Build automated billing systems for recurring payments, invoicing, subscription lifecycle, and dunning management. Use when implementing subscription billing, automating invoicing, or managing recurring payment systems.

1098

hubspot-integration

davila7

Expert patterns for HubSpot CRM integration including OAuth authentication, CRM objects, associations, batch operations, webhooks, and custom objects. Covers Node.js and Python SDKs. Use when: hubspot, hubspot api, hubspot crm, hubspot integration, contacts api.

540

Search skills

Search the agent skills registry