Microsoft Azure Cosmos

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.

  1. Use Primary Keys i.e. add specific credentials (client_id, secret, tenant) and account name to the Airflow connection.

Default Connection IDs

All hooks and operators related to Microsoft Azure Cosmos use azure_cosmos_default by default.

Configuring the Connection

Login

Specify the Cosmos Endpoint URI used for the initial connection.

Password

Specify the Cosmos Master Key Token used for the initial connection.

Extra (optional)

Specify the extra parameters (as json dictionary) that can be used in Azure Cosmos connection. The following parameters are all optional:

  • database_name: Specify the azure cosmos database to use.

  • collection_name: Specify the azure cosmos collection to use.

When specifying the connection in environment variable you should specify it using URI syntax.

Note that all components of the URI should be URL-encoded.

For example:

export AIRFLOW_CONN_AZURE_COSMOS_DEFAULT='azure-cosmos://https%3A%2F%2Fairflow.azure.com:master%20key@?database_name=mydatabase&collection_name=mycollection'

Was this entry helpful?