blob: 108234e8153625999a39b00ad67e4112e70e62a1 [file] [log] [blame]
:py:mod:`airflow.providers.microsoft.azure.hooks.adx`
=====================================================
.. py:module:: airflow.providers.microsoft.azure.hooks.adx
.. autoapi-nested-parse::
This module contains Azure Data Explorer hook.
.. spelling::
KustoResponseDataSetV
kusto
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.microsoft.azure.hooks.adx.AzureDataExplorerHook
.. py:class:: AzureDataExplorerHook(azure_data_explorer_conn_id = default_conn_name)
Bases: :py:obj:`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.
:param azure_data_explorer_conn_id: Reference to the
:ref:`Azure Data Explorer connection<howto/connection:adx>`.
.. py:attribute:: conn_name_attr
:annotation: = azure_data_explorer_conn_id
.. py:attribute:: default_conn_name
:annotation: = azure_data_explorer_default
.. py:attribute:: conn_type
:annotation: = azure_data_explorer
.. py:attribute:: hook_name
:annotation: = Azure Data Explorer
.. py:method:: get_connection_form_widgets()
:staticmethod:
Returns connection widgets to add to connection form
.. py:method:: get_ui_field_behaviour()
:staticmethod:
Returns custom field behaviour
.. py:method:: get_conn()
Return a KustoClient object.
.. py:method:: run_query(query, database, options = None)
Run KQL query using provided configuration, and return
`azure.kusto.data.response.KustoResponseDataSet` instance.
If query is unsuccessful AirflowException is raised.
:param query: KQL query to run
:param database: Database to run the query on.
:param options: Optional query options. See:
https://docs.microsoft.com/en-us/azure/kusto/api/netfx/request-properties#list-of-clientrequestproperties
:return: dict