I got it working with this...thanks
string str = JsonConvert.SerializeObject(ID);
ClientRequestProperties clientRequestProperties = new ClientRequestProperties();
clientRequestProperties.SetParameter("value", str);
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hey,
I'm trying to create an Azure Function that queries the adx database.
In my function would I create an object or list to pass to the Stored Function
Using this in the in the code but getting an error
queryGetTransaction = "declare query_parameters(ID:dynamic); GetTransaction(ID)";
Error:
Text=declare query_parameters(ID:dynamic); GetTransaction(ID)
SemanticErrors='ID' invalid query parameter type (expected 'dynamic)
How would i set that Dynamic parameter with
ClientRequestProperties clientRequestProperties = new ClientRequestProperties();
If I'm not doing this correctly can I pass an object to the stored function and use that for parameters in the where?
I got it working with this...thanks
string str = JsonConvert.SerializeObject(ID);
ClientRequestProperties clientRequestProperties = new ClientRequestProperties();
clientRequestProperties.SetParameter("value", str);
I was able to get it working with the following Approach & Funda.
ClientRequestProperties.SetParameter() doesn't have 'dynamic' type overload for the Value. So declare Query_Parameters with type as "string" to take the input values.
And while calling the function inside the query use "todynamic(stringTypedValue)" to convert the string value to Dynamic Object on the fly.
Pass in the string value as "',' separated values array" parsable by parse_json function => Like ( parse_json('[1, 2, 3, 4]', parse_json('["str1","str2","str3"]'). C# takes in this value as input string while converting it into dynamic type in Kusto on the fly.
That string is supposed to be converted into the following "dynamic object form" in Kusto => https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/dynamic.
you can send me an email => vakancharla@microsoft.com, if you need any further information.
Please follow original doc https://learn.microsoft.com/en-us/azure/data-explorer/kusto/api/netfx/client-request-properties
You can pass scalar type (es. dynamic) from Kusto.Data using KQL literal as Parameters in ClientRequestProperties):
eg.
declare query_parameters(arrayOfGuids: dynamic, ...)
...
var clientRequestProperties = new ClientRequestProperties()
clientRequestProperties.SetParameter("arrayOfGuids", "dynamic(['guid1', 'guid2'])")
Parameters passed must be key-values string but values can be interpreted as common type (es. string, int, long, ..) as well as KQL literal (datetime(..), dynamic(..), ...)