Skip to content

Commit

Permalink
Expanding docs on client auth for AzureKeyVaultBackend (#18659)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbegg authored Oct 3, 2021
1 parent 3a59a85 commit 6d504b4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions airflow/providers/microsoft/azure/secrets/azure_key_vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ class AzureKeyVaultBackend(BaseSecretsBackend, LoggingMixin):
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``.
.. seealso::
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
:param connections_prefix: Specifies the prefix of the secret to read to get Connections
If set to None (null), requests for connections will not be sent to Azure Key Vault
:type connections_prefix: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Here is a sample configuration:
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``.

Optional lookup
"""""""""""""""

Expand Down Expand Up @@ -64,3 +66,8 @@ Storing and Retrieving Variables

If you have set ``variables_prefix`` as ``airflow-variables``, then for an Variable key of ``hello``,
you would want to store your Variable at ``airflow-variables-hello``.

Reference
"""""""""

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>`_.

0 comments on commit 6d504b4

Please sign in to comment.