Giter Club home page Giter Club logo

Comments (8)

amalathask avatar amalathask commented on August 30, 2024 1

Hi @yogilad,

I'm using the KustoSDK.

public static void main(String[] args) {
        try {
            ConnectionStringBuilder csb = ConnectionStringBuilder.createWithAadApplicationCredentials(
                    System.getenv("clusterPath"),
                    System.getenv("appId"),
                    System.getenv("appKey"),
                    System.getenv("appTenant"));
            ClientImpl client = new ClientImpl(csb);

            KustoOperationResult results = client.execute(System.getenv("dbName"), System.getenv("query"));
            KustoResultSetTable mainTableResult = results.getPrimaryResults();
            System.out.println(String.format("Kusto sent back %s rows.", mainTableResult.count()));

            // iterate values
            while (mainTableResult.next()) {
                List<Object> nextValue = mainTableResult.getCurrentRow();
            }

            // in case we want to pass client request properties
            ClientRequestProperties clientRequestProperties = new ClientRequestProperties();
            clientRequestProperties.setTimeoutInMilliSec(TimeUnit.MINUTES.toMillis(1));

            results = client.execute(System.getenv("dbName"), System.getenv("query"), clientRequestProperties);
            System.out.println(results.getPrimaryResults().getData());

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

For the URL I'm using the following: https://ade.applicationinsights.io/subscriptions/{subscription-id}/resourceGroups/{resourceGroup}/providers/microsoft.insights/components/{cluster}

I'm able to access the cluster from the Azure Data Explorer (https://dataexplorer.azure.com/) when I've added the Application Insights component as a cluster.

from azure-kusto-java.

yogilad avatar yogilad commented on August 30, 2024 1

I believe the C# SDK supports this and includes some specific adaptations to the authentication code to support it.
I'll double check and let you know if there's a way to work around those.

from azure-kusto-java.

yogilad avatar yogilad commented on August 30, 2024

Hi @amalathask ,

Are you trying to authenticate (and connect) to Azure App Insights with KustoSDK or are you trying to authenticate to the underlying Kusto Service?
Can you share your code for setting up the client with values of al l fields (minus any credentials of course)?
Are you able to access your cluster from Kusto Explorer?

from azure-kusto-java.

rongshabing avatar rongshabing commented on August 30, 2024

Hi @yogilad

Following up on this, do you know if it is possible at all to receive data from application insights through the Kusto SDK? If yes, do you have an example on how to do it?

We followed this site: https://docs.microsoft.com/en-us/azure/data-explorer/query-monitor-data to add an Application Insights cluster to our Azure Data Explorer which worked fine.

from azure-kusto-java.

yogilad avatar yogilad commented on August 30, 2024

Hi,
Query is possible via a proxy mentioned in the above example provided by @amalathask.
You need to use a late client version which includes some changes to the authentication flow.

from azure-kusto-java.

rongshabing avatar rongshabing commented on August 30, 2024

Hi @yogilad
What do you mean by a late client version? Do you have an example for that? We are currently using the newest version of the SDK and getting the same error.

from azure-kusto-java.

yogilad avatar yogilad commented on August 30, 2024

Hi @rongshabing ,
Can you make sure your client passes through this line?

Also, can you share your activity id from the exception you get?

from azure-kusto-java.

yihezkel avatar yihezkel commented on August 30, 2024

Hi @rongshabing,

In response to your question on September 1, @yogilad was referring to a relatively recent version of this client, which includes the changes he referenced. Ideally the latest version :-)

In any case, since we haven't heard from you in 5 months, we're going to close this issue. If you still need help, please reopen with a response to our questions above.

from azure-kusto-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.