Skip to content

azure_key_vault

mlflow_secrets_auth.providers.azure_key_vault

Azure Key Vault authentication provider.

AzureKeyVaultAuthProvider()

Bases: SecretsBackedAuthProvider

Authentication provider using Azure Key Vault.

Requires optional dependencies: azure-identity and azure-keyvault-secrets.

Environment variables

AZURE_KEY_VAULT_URL: Full Key Vault URL (e.g., "https://myvault.vault.azure.net"). Required. MLFLOW_AZURE_SECRET_NAME: Secret name to retrieve. Required. MLFLOW_AZURE_AUTH_MODE: "bearer" (default) or "basic". MLFLOW_AZURE_TTL_SEC: Cache TTL in seconds (defaults to provider's default TTL).

Initialize the provider with a default TTL and a lazy SecretClient.

Source code in src/mlflow_secrets_auth/providers/azure_key_vault.py
def __init__(self) -> None:
    """Initialize the provider with a default TTL and a lazy SecretClient."""
    super().__init__(PROVIDER_AZURE, default_ttl=DEFAULT_TTL_SECONDS)
    self._secret_client: Any | None = None  # azure.keyvault.secrets.SecretClient when available