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.

close() None[source]

Closes the connection to Azure App Configuration.

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.

Parameters:
  • key (str) – The key of the value to get.

  • default – The default value to return.

Type:

str or None

Returns:

The value of the specified key.

Return type:

Union[str, JSON]

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.

Returns:

A set-like object of key-value pairs loaded from Azure App Configuration.

Return type:

ItemsView[str, Union[str, Mapping[str, Any]]]

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]

refresh(**kwargs) None[source]
values() ValuesView[str | Mapping[str, Any]]

Returns a list of values loaded from Azure App Configuration. Any values that are Key Vault references will be resolved.

Returns:

A list of values loaded from Azure App Configuration. The values are either Strings or JSON objects, based on there content type.

Return type:

ValuesView[Union[str, Mapping[str, Any]]]

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.

key: str

Alias for field number 0

label: str

Alias for field number 1

azure.appconfiguration.provider.load(*args, **kwargs) AzureAppConfigurationProvider[source]

Subpackages