How to query Kusto data with an appID and REST API using a cross-cluster join query

David Williams (TATA CONSULTANCY SERVICES LTD) 0 Reputation points Microsoft Vendor
2024-02-13T00:23:08.44+00:00

I am writing code for an Azure function app that query Kusto using the REST API. The function app uses an appID which has access to various clusters in the tenant. To use the API, you of course need a bearer token, which works. A simple query to the database in the cluster produces a table result as it should, so authorization is not the obstacle. The problem is the KQL query uses "let" statements that access separate clusters before joining/comparing the tables created. This approach has been tested and works in Azure Data Explorer. But from Azure, it seems I can only obtain a token for one host/resource at a time. So, while the first part of the query works, the part that queries a separate cluster fails because the token is invalid for the rest of the clusters I am joining. Is there a way to get a token that has multiple audiences so that I can use one query from my function app? All research I have found does not indicate a way to do that with OAUTH2 / JWTs. Thanks in advance!

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.
501 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,321 Reputation points Microsoft Employee
    2024-02-15T06:30:15.07+00:00

    Hi David Williams (TATA CONSULTANCY SERVICES LTD), Thank you for posting query in Microsoft Q&A Platform.

    Could you please try to giving access to multiple cluster for your app id?

    Also, for better understanding on how rest api is working, could you please share REST API details along with request details which you are using here? Thank you.