Skip to content
Advertisement

Is it possible to use a dynamic array/list as input for parameterizing a kusto query?

I have an application that uses the Python library azure.kusto.data to query data from a Kusto cluster. I’m wondering, is it possible to use a dynamic array as input for paramterizing a kusto query?

The existing documentation doesn’t seem to call out such functionality. https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/queryparametersstatement?pivots=azuredataexplorer

Passing in string type values has worked fine in the past:

JavaScript

I will then pass the dictionary and query string into the Kusto library to get the data I need. This works fine. What does not work fine is whenever I try some version of this:

JavaScript

I’ve tried many different iterations of this and can’t seem to get it to work. The only other idea I have at this point would be to pass in value_list as a delimited string (e.g., “1-2-3-4”) and use the split() function in kusto to deserialize the string back to an array, but this doesn’t seem ideal.

Any tips or pointers would be appreciated – I’ve scoured the Kusto docs/Google and haven’t come across any good examples online.

Thanks!

Advertisement

Answer

The value in the parameter list has to be a literal, for dynamic arrays a literal looks like this:

JavaScript

for example:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement