You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2023/09/05 14:38:44 UTC

[airflow] branch main updated: docs(providers/microsoft): improve documentation for AzureCosmosDBHook DefaultAzureCredential support (#34102)

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 4254cfc8ec docs(providers/microsoft): improve documentation for AzureCosmosDBHook DefaultAzureCredential support (#34102)
4254cfc8ec is described below

commit 4254cfc8ec44490d3633f2c0180b577b3c10abf9
Author: Wei Lee <we...@gmail.com>
AuthorDate: Tue Sep 5 22:38:37 2023 +0800

    docs(providers/microsoft): improve documentation for AzureCosmosDBHook DefaultAzureCredential support (#34102)
---
 .../connections/azure_cosmos.rst                        | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/docs/apache-airflow-providers-microsoft-azure/connections/azure_cosmos.rst b/docs/apache-airflow-providers-microsoft-azure/connections/azure_cosmos.rst
index 1de96f2ea5..3c54b98bc2 100644
--- a/docs/apache-airflow-providers-microsoft-azure/connections/azure_cosmos.rst
+++ b/docs/apache-airflow-providers-microsoft-azure/connections/azure_cosmos.rst
@@ -27,11 +27,12 @@ The Microsoft Azure Cosmos connection type enables the Azure Cosmos Integrations
 Authenticating to Azure
 -----------------------
 
-There is one way to connect to Azure Cosmos using Airflow.
+There are two ways to connect to Azure Cosmos using Airflow.
 
-1. Use `Primary Keys
-   <https://docs.microsoft.com/en-us/azure/cosmos-db/secure-access-to-data#primary-keys>`_
+1. Use `Primary Keys`_
    i.e. add specific credentials (client_id, secret, tenant) and account name to the Airflow connection.
+2. Fallback on DefaultAzureCredential_.
+   This includes a mechanism to try different options to authenticate: Managed System Identity, environment variables, authentication through Azure CLI, etc.
 
 Default Connection IDs
 ----------------------
@@ -44,8 +45,9 @@ Configuring the Connection
 Login
     Specify the Cosmos Endpoint URI used for the initial connection.
 
-Password
+Password (optional)
     Specify the Cosmos Master Key Token used for the initial connection.
+    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 Cosmos connection.
@@ -53,6 +55,9 @@ Extra (optional)
 
     * ``database_name``: Specify the azure cosmos database to use.
     * ``collection_name``: Specify the azure cosmos collection to use.
+    * ``subscription_id``: Specify the ID of the subscription used for the initial connection. Required for falling back to DefaultAzureCredential_
+    * ``resource_group_name``: Specify the  Azure Resource Group Name under which the desired azure cosmos resides. Required for falling back to DefaultAzureCredential_
+
 
 When specifying the connection in environment variable you should specify
 it using URI syntax.
@@ -64,3 +69,7 @@ For example:
 .. code-block:: bash
 
    export AIRFLOW_CONN_AZURE_COSMOS_DEFAULT='azure-cosmos://https%3A%2F%2Fairflow.azure.com:master%20key@?database_name=mydatabase&collection_name=mycollection'
+
+
+.. _Primary Keys: https://docs.microsoft.com/en-us/azure/cosmos-db/secure-access-to-data#primary-keys
+.. _DefaultAzureCredential: https://docs.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python#defaultazurecredential