This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 6b923299a1 Improve documentation for AzureBaseHook
DefaultAzureCredential support (#34097)
6b923299a1 is described below
commit 6b923299a12a925889cb93f31af23db261690127
Author: Wei Lee <[email protected]>
AuthorDate: Tue Sep 5 22:42:27 2023 +0800
Improve documentation for AzureBaseHook DefaultAzureCredential support
(#34097)
* docs(providers/microsoft): improve documentation for AzureBaseHook
DefaultAzureCredential support
* docs(providers/microsoft): add link to where DefaultAzureCredential is
mentioned
* docs(providers/microsoft): extract links to doc end
---
.../connections/azure.rst | 27 ++++++++++++++--------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git
a/docs/apache-airflow-providers-microsoft-azure/connections/azure.rst
b/docs/apache-airflow-providers-microsoft-azure/connections/azure.rst
index bae0d415c5..0b82d14667 100644
--- a/docs/apache-airflow-providers-microsoft-azure/connections/azure.rst
+++ b/docs/apache-airflow-providers-microsoft-azure/connections/azure.rst
@@ -27,17 +27,16 @@ The Microsoft Azure connection type enables the Azure
Integrations.
Authenticating to Azure
-----------------------
-There are three ways to connect to Azure using Airflow.
+There are four ways to connect to Azure using Airflow.
-1. Use `token credentials
-
<https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate?tabs=cmd#authenticate-with-token-credentials>`_
+1. Use `token credentials`_
i.e. add specific credentials (client_id, secret, tenant) and subscription
id to the Airflow connection.
-2. Use a `JSON file
-
<https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate?tabs=cmd#authenticate-with-a-json-file>`_
- i.e. create a key file on disk and link to it in the Airflow connection.
-3. Use a `JSON dictionary
-
<https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate?tabs=cmd#authenticate-with-a-json-dictionary>`_
+2. Use a `JSON file`_
+3. Use a `JSON dictionary`_
i.e. add a key config directly into the Airflow connection.
+4. Fallback on `DefaultAzureCredential`_.
+ This includes a mechanism to try different options to authenticate: Managed
System Identity, environment variables, authentication through Azure CLI and
etc.
+ ``subscriptionId`` is required in this authentication mechanism.
Only one authorization method can be used at a time. If you need to manage
multiple credentials or keys then you should
configure multiple connections.
@@ -53,10 +52,12 @@ Configuring the Connection
Login (optional)
Specify the ``client_id`` used for the initial connection.
This is only needed for *token credentials* authentication mechanism.
+ It can be left out to fall back on DefaultAzureCredential_.
Password (optional)
Specify the ``secret`` used for the initial connection.
This is only needed for *token credentials* authentication mechanism.
+ It can be left out to fall back on DefaultAzureCredential_.
Extra (optional)
Specify the extra parameters (as json dictionary) that can be used in
Azure connection.
@@ -65,12 +66,14 @@ Extra (optional)
* ``tenantId``: Specify the tenant to use.
This is only needed for *token credentials* authentication mechanism.
* ``subscriptionId``: Specify the subscription id to use.
- This is only needed for *token credentials* authentication mechanism.
+ This is only needed for *token credentials* and DefaultAzureCredential_
authentication mechanism.
* ``key_path``: If set, it uses the *JSON file* authentication mechanism.
It specifies the path to the json file that contains the authentication
information.
* ``key_json``: If set, it uses the *JSON dictionary* authentication
mechanism.
It specifies the json that contains the authentication information.
+ The entire extra column can be left out to fall back on
DefaultAzureCredential_.
+
When specifying the connection in environment variable you should specify
it using URI syntax.
@@ -81,3 +84,9 @@ For example:
.. code-block:: bash
export AIRFLOW_CONN_AZURE_DEFAULT='azure://?key_path=%2Fkeys%2Fkey.json'
+
+
+.. _token credentials:
https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate?tabs=cmd#authenticate-with-token-credentials
+.. _JSON file:
https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate?tabs=cmd#authenticate-with-a-json-file
+.. _JSON dictionary:
https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate?tabs=cmd#authenticate-with-a-json-dictionary>
+.. _DefaultAzureCredential:
https://docs.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python#defaultazurecredential