airflow.providers.microsoft.azure.hooks.adx
¶
This module contains Azure Data Explorer hook.
Module Contents¶
Classes¶
Interacts with Azure Data Explorer (Kusto). |
- class airflow.providers.microsoft.azure.hooks.adx.AzureDataExplorerHook(azure_data_explorer_conn_id=default_conn_name)[source]¶
Bases:
airflow.hooks.base.BaseHook
Interacts with Azure Data Explorer (Kusto).
Cluster:
Azure Data Explorer cluster is specified by a URL, for example: “https://help.kusto.windows.net”. The parameter must be provided through the Data Explorer Cluster URL connection detail.
Tenant ID:
To learn about tenants refer to: https://docs.microsoft.com/en-us/onedrive/find-your-office-365-tenant-id
Authentication methods:
Available authentication methods are:
AAD_APP: Authentication with AAD application certificate. A Tenant ID is required when using this method. Provide application ID and application key through Username and Password parameters.
AAD_APP_CERT: Authentication with AAD application certificate. Tenant ID, Application PEM Certificate, and Application Certificate Thumbprint are required when using this method.
AAD_CREDS: Authentication with AAD username and password. A Tenant ID is required when using this method. Username and Password parameters are used for authentication with AAD.
AAD_DEVICE: Authenticate with AAD device code. Please note that if you choose this option, you’ll need to authenticate for every new instance that is initialized. It is highly recommended to create one instance and use it for all queries.
- Parameters
azure_data_explorer_conn_id (str) – Reference to the Azure Data Explorer connection.
- run_query(query, database, options=None)[source]¶
Run KQL query using provided configuration, and return azure.kusto.data.response.KustoResponseDataSet instance. If query is unsuccessful AirflowException is raised.
- Parameters
query (str) – KQL query to run
database (str) – Database to run the query on.
options (dict | None) – Optional query options. See: https://docs.microsoft.com/en-us/azure/kusto/api/netfx/request-properties#list-of-clientrequestproperties
- Returns
dict
- Return type
azure.kusto.data.response.KustoResponseDataSetV2