azure.appconfiguration.provider package
- class azure.appconfiguration.provider.AzureAppConfigurationKeyVaultOptions(*, credential: TokenCredential | AsyncTokenCredential | None = None, client_configs: Mapping[str, Mapping[str, Any]] | None = None, secret_resolver: Callable[[str], str] | Callable[[str], Awaitable[str]] | None = None)[source]
Options for connecting to Key Vault.
- Keyword Arguments:
credential (TokenCredential) – A credential for authenticating with the key vault. This is optional if secret_clients is provided.
client_configs (Mapping[Url, Mapping]) – A Mapping of SecretClient endpoints to client configurations from azure-keyvault-secrets. This is optional if credential is provided. If a credential isn’t provided a credential will need to be in each set for each.
secret_resolver (Callable[[str], str]) – A function that takes a URI and returns a value.
- class azure.appconfiguration.provider.AzureAppConfigurationProvider(**kwargs: Any)[source]
Provides a dictionary-like interface to Azure App Configuration settings. Enables loading of sets of configuration settings from Azure App Configuration into a Python application. Enables trimming of prefixes from configuration keys. Enables resolution of Key Vault references in configuration settings.
- get(key: str, default: str | Mapping[str, Any] | _T | None = None) str | Mapping[str, Any] | _T | None
Returns the value of the specified key. If the key does not exist, returns the default value.
- items() ItemsView[str, str | Mapping[str, Any]]
- Returns a set-like object of key-value pairs loaded from Azure App Configuration. Any values that are Key Vault
references will be resolved.
- keys() KeysView[str]
Returns a list of keys loaded from Azure App Configuration.
- Returns:
A list of keys loaded from Azure App Configuration.
- Return type:
KeysView[str]
- class azure.appconfiguration.provider.SettingSelector(*, key_filter: str, label_filter: str | None = '\x00')[source]
Selects a set of configuration settings from Azure App Configuration.
- Keyword Arguments:
key_filter – A filter to select configuration settings based on their keys.
label_filter – A filter to select configuration settings based on their labels. Default is value is EMPTY_LABEL i.e. (No Label) as seen in the portal.
- class azure.appconfiguration.provider.WatchKey(key, label)[source]
Create new instance of WatchKey(key, label)
- count(value, /)
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- azure.appconfiguration.provider.load(*args, **kwargs) AzureAppConfigurationProvider[source]