Dhiraj
Dhiraj

Reputation: 3696

How to execute Kusto query (not command) in ADF

There is an ADX Command activity in ADF where we can specify any Kusto command. But what if I have query and not a command , that fetches some metadata which I would like to use within ADF pipeline logic ? Is there any way to run this? ADX command activity only allows commands and not queries? I know that Copy activity allows specifying source dataset of ADX type and that way we can specify a query. But my goal is not to copy this to somewhere, I would like my pipeline flow to read the output returned by this query (it could be low sized metadata , maybe 2-3000 rows) and take some actions. If there is no ADF way to do this, is there any workaround in Kusto , like some command that runs a query?

Upvotes: 0

Views: 1311

Answers (2)

Master_GoGo
Master_GoGo

Reputation: 1690

I have used a Azure Data Explorer Command activity for this recently in one of my work and It works like a charm.

We can run definition query(.show) as well as control queries(.clear) using ADX Command activity.

enter image description here

Upvotes: 0

Aswin
Aswin

Reputation: 7156

You can use lookup activity in Azure data factory to execute kusto query.

  1. Create a linked service for azure data explorer cluster.
  2. Create a source dataset with the linked service created in step:1
  3. Take a lookup activity and give the source dataset.
  4. Enter the Kusto query in the query text box.

enter image description here

The output of the lookup activity will contain the result of the Kusto Query. You can use this output in other activities of pipeline flow to take the required actions.

Upvotes: 0

Related Questions