Why do I get error for cross querying in Kusto

Heidi Zhang 0 Reputation points Microsoft Employee
2024-05-13T19:29:40.3966667+00:00

I can run my function successfully in local cluster but get errors while running in other clusters:

Errors occurred while resolving remote entities. Cluster='https://dummy.kusto.windows.net/', Database='DummyDB': Semantic error: Schema of the stored function 'AllMgmtSmsAccountTrace' expected to be constant and not to depend on input arguments or data. Error details: SEM0001: evaluate execute_query(): the following error(s) occurred while evaluating the output schema: evaluate execute_query() is not allowed in this context.

Example of my query

cluster('dummy.kusto.windows.net').database('DummyDB').AllMgmtSmsAccountTrace

| take 10

Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
487 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde 29,616 Reputation points MVP
    2024-05-13T19:48:07.8833333+00:00

    Hello @Heidi Zhang ,

    welcome to this moderated Azure community forum.

    I tried to replicate your example:

    cluster('https://kvcb9e932a678234837be0.northeurope.kusto.windows.net').database('freeclustervandeveldeonline').MyFunction1()
    | take 5
    

    I was based on an existing stored function:

    User's image

    Notice I added round brackets '()' at the end, after the function name.

    This gives a correct result:

    User's image

    Can you add the round brackets and check your query again?


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.