The Microsoft App Configuration Data Client Library for Python provides functionality to manage application settings and feature flags in Azure App Configuration. It is currently at version 1.8.0 and follows the Azure SDK's regular release cadence, with updates typically several times a year.
pip install azure-appconfiguration azure-identityVerified import paths — ran on the pinned version, not inferred.
Connect to an Azure App Configuration store and retrieve a key-value setting using `DefaultAzureCredential` for authentication. Remember to set the `AZURE_APPCONFIGURATION_ENDPOINT` environment variable and ensure the specified key exists.
Verify `az login` status, ensure required environment variables are correctly configured, or use a more specific credential type like `ClientSecretCredential` if `DefaultAzureCredential` is problematic.
Always consider if your configuration settings use labels. Explicitly include the `label` parameter in `get_configuration_setting` or `label_filter` in `list_configuration_settings` if your settings are labeled. Use `label=None` or `label_filter=LabelFilter.NULL` to specifically target settings without a label.
Grant the appropriate RBAC roles ('App Configuration Data Reader' or 'App Configuration Data Owner') to the identity used by `DefaultAzureCredential` (e.g., your user account, service principal, or managed identity) on the Azure App Configuration resource.Use `AsyncAzureAppConfigurationClient` with `await` in an `async` function for asynchronous operations, or stick to `AzureAppConfigurationClient` for synchronous code. Do not mix them without explicitly managing task execution.
Ensure the `AZURE_APPCONFIGURATION_ENDPOINT` environment variable is correctly set to the URL of your Azure App Configuration store (e.g., `https://<your-store-name>.azconfig.io`). Alternatively, pass the endpoint directly to the client constructor using the `base_url` argument: `AzureAppConfigurationClient(base_url='https://<your-store-name>.azconfig.io', credential=DefaultAzureCredential())`.
Ensure the Azure App Configuration store endpoint is provided. Set the `AZURE_APPCONFIGURATION_ENDPOINT` environment variable (e.g., `https://<your-appconfig-name>.azconfig.io`) or pass the endpoint directly to the client constructor, like `AzureAppConfigurationClient(base_url='https://<your-appconfig-name>.azconfig.io')`.