A

Skill 详情

azure-appconfiguration-py

Azure App Configuration SDK for Python. Use for centralized configuration management, feature flags, and dynamic settings.

来源平台:GitHub
来源标识:sickn33/antigravity-awesome-skills
源文件:原始说明
AI 平台与模型 超热门 GitHub 中 风险 下载 1.99万Stars 3.68万 GitHub Copilot
来源平台GitHub
文档版本SKILL.md
热度超热门
排名信号下载 1.99万
概述 安装 文档 下载

快速判断

Azure App Configuration SDK for Python. Use for centralized configuration management, feature flags, and dynamic settings.

最后校验2026-05-27
来源平台GitHub
安全提示
下载副本ZIP 可用

适合任务

  • 把重复任务整理成可复用的 AI 操作流程。
  • 让 AI 在特定场景下按统一规范执行。
  • 为团队或个人工作流提供可复制的任务说明。

输入与输出

输入:任务目标、上下文材料、文件路径、约束条件或需要处理的内容。

输出:按 Skill 说明生成的文档、代码、检查结果、计划、建议或操作步骤。

示例任务

  • 使用 azure-appconfiguration-py 帮我处理当前任务,并说明执行前需要确认的输入。
  • 根据 azure-appconfiguration-py 的说明,给我一个安全的使用步骤清单。

安装方式

  1. 下载本站提供的 Skill ZIP 并解压。
  2. 把解压后的 Skill 目录放入当前 AI 工具支持的 skills 目录。
  3. 如需在线查看原始内容,可打开 GitHub 的 SKILL.md

在线原始地址:azure-appconfiguration-py/SKILL.md

风险边界

使用前请检查权限、外部依赖和要处理的数据类型。不要把密码、密钥、身份信息或敏感客户资料交给未经确认的 Skill。

SKILL.md 文档介绍

Azure App Configuration SDK for Python

Centralized configuration management with feature flags and dynamic settings.

Installation

pip install azure-appconfiguration

Environment Variables

AZURE_APPCONFIGURATION_CONNECTION_STRING=Endpoint=https://<name>.azconfig.io;Id=...;Secret=...
# Or for Entra ID:
AZURE_APPCONFIGURATION_ENDPOINT=https://<name>.azconfig.io

Authentication

Connection String

from azure.appconfiguration import AzureAppConfigurationClient

client = AzureAppConfigurationClient.from_connection_string(
    os.environ["AZURE_APPCONFIGURATION_CONNECTION_STRING"]
)

Entra ID

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

client = AzureAppConfigurationClient(
    base_url=os.environ["AZURE_APPCONFIGURATION_ENDPOINT"],
    credential=DefaultAzureCredential()
)

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():
    credential = DefaultAzureCredential()
    client = AzureAppConfigurationClient(
        base_url=endpoint,
        credential=credential
    )
    
    setting = await client.get_configuration_setting(key="app:message")
    print(setting.value)
    
    await client.close()
    await credential.close()

Client Operations

| Operation | Description |

|-----------|-------------|

| get_configuration_setting | Get single setting |

| set_configuration_setting | Create or update setting |

| delete_configuration_setting | Delete setting |

| list_configuration_settings | List with filters |

| set_read_only | Lock/unlock setting |

| begin_create_snapshot | Create point-in-time snapshot |

| list_snapshots | List all snapshots |

Best Practices

1. Use labels for environment separation (dev, staging, prod)

2. Use key prefixes for logical grouping (app:database:*, app:cache:*)

3. Make production settings read-only to prevent accidental changes

4. Create snapshots before deployments for rollback capability

5. Use Entra ID instead of connection strings in production

6. Refresh settings periodically in long-running applications

7. Use feature flags for gradual rollouts and A/B testing

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
建议反馈