AzureKeyVaultBackend
Microsoft AzureRetrieves Airflow Connections or Variables from Azure Key Vault secrets.
Access Instructions
Install the Microsoft Azure provider package into your Airflow environment.
Update your environment config per the instructions in the docs below.
Parameters
Documentation
Retrieves Airflow Connections or Variables from Azure Key Vault secrets.
The Azure Key Vault can be configured as a secrets backend in the airflow.cfg
:
[secrets]backend = airflow.providers.microsoft.azure.secrets.key_vault.AzureKeyVaultBackendbackend_kwargs = {"connections_prefix": "airflow-connections", "vault_url": "<azure_key_vault_uri>"}
For example, if the secrets prefix is airflow-connections-smtp-default
, this would be accessible if you provide {"connections_prefix": "airflow-connections"}
and request conn_id smtp-default
. And if variables prefix is airflow-variables-hello
, this would be accessible if you provide {"variables_prefix": "airflow-variables"}
and request variable key hello
.
For client authentication, the DefaultAzureCredential
from the Azure Python SDK is used as credential provider, which supports service principal, managed identity and user credentials
For example, to specify a service principal with secret you can set the environment variables AZURE_TENANT_ID
, AZURE_CLIENT_ID
and AZURE_CLIENT_SECRET
.
See also
For more details on client authentication refer to the DefaultAzureCredential
Class reference: https://docs.microsoft.com/en-us/python/api/azure-identity/azure.identity.defaultazurecredential?view=azure-python