Azure Key Vault
Class: AzureKeyVaultManager
Section titled “Class: AzureKeyVaultManager”Connects to an Azure Key Vault, fetches secrets on demand (with optional JSON parsing), and caches them to minimize redundant fetches. It supports:
- Dictionary-style usage (
manager["secret_key"]) - A
.get()method for JSON-parsed secrets - Bulk fetches using a list of
(secret_key, parse_json)tuples
# Create a manager for your vaultmanager = AzureKeyVaultManager("my-vault-name")Dictionary-style access (no JSON parsing)
Section titled “Dictionary-style access (no JSON parsing)”# Equivalent to parse_json=Falsesecret_plain = manager["some_secret_key"]Using .get() with optional JSON parsing
Section titled “Using .get() with optional JSON parsing”# Enable JSON parsing for structured secretssecret_parsed = manager.get("json_secret_key", parse_json=True)Bulk fetch usage
Section titled “Bulk fetch usage”# Fetch multiple secrets at once with parse_json flagssecrets_dict = manager.fetch_secrets([ ("secretA", True), ("secretB", False),])