airflow.providers.microsoft.azure.hooks.adx

This module contains Azure Data Explorer hook.

Module Contents

Classes

AzureDataExplorerHook

Interact 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

Interact 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.

conn_name_attr = 'azure_data_explorer_conn_id'[source]
default_conn_name = 'azure_data_explorer_default'[source]
conn_type = 'azure_data_explorer'[source]
hook_name = 'Azure Data Explorer'[source]
classmethod get_connection_form_widgets()[source]

Return connection widgets to add to connection form.

classmethod get_ui_field_behaviour()[source]

Return custom field behaviour.

connection()[source]

Return a KustoClient object (cached).

get_conn()[source]

Return a KustoClient object.

run_query(query, database, options=None)[source]

Run KQL query using provided configuration, and return KustoResponseDataSet instance.

See: azure.kusto.data.response.KustoResponseDataSet If query is unsuccessful AirflowException is raised.

Parameters
Returns

dict

Return type

azure.kusto.data.response.KustoResponseDataSetV2

Was this entry helpful?