【问题标题】:How to query my Application Insights Logs (Analytics) from Kusto.Explorer?How to query my Application Insights Logs (Analytics) from Kusto.Explorer?
【发布时间】:2022-12-19 10:03:05
【问题描述】:

Update July 13, 2021

The links used below are now partially obsolete. Here is the new section on language differences.

Original post

On Azure Portal, in my App Insights / Logs view, I can query the app data like this:

app('my-app-name').traces

The app function is described in the article app() expression in Azure Monitor query.

Kusto.Explorer doesn't understand the app() function, which appears to be explained by the fact it is one of the Additional operators in Azure Monitor.

How can I query my App Insights / Logs with Kusto.Explorer? I cannot use cluster as it is one of the functions not supported in Azure Monitor.

Relevant doc: Azure Monitor log query language differences

Note on troubleshooting joins

(added December 16, 2021)

Pro-tip from Kusto team: If you are querying application insights from Kusto.Explorer, and your joins to normal clusters fail with bad gateway or other unexpected error, consider adding hint.remote=left to your join. Like:

tableFromApplicationInsights
| join kind=innerunique hint.remote=left tableFromNormalKustoCluster

【问题讨论】:

    标签: azure azure-application-insights azure-data-explorer azure-log-analytics kql


    【解决方案1】:

    We have a private preview for Azure Data Explorer (ADX) Proxy that enables you to treat Log Analytics / Application Insights as a virtual cluster, query it using ADX tools and connecting to it as a second cluster in cross cluster query. Since its a private preview you need to contact adxproxy@microsoft.com in order to get enrolled. The proxy is documented at https://learn.microsoft.com/en-us/azure/data-explorer/query-monitor-data.

    (disclaimer - I'm the PM driving this project).

    【讨论】:

    • Just as a heads-up, when answering questions about your own product or service, you need to disclose your affiliation in the answer itself.
    • NIce! I won't be able to sign up for the private preview as the timeframe is all wrong (I'm at a client site right now and wanted this today). I would love to have this, and very happy you're working on it. :)
    • Hi - this is up and running now. Please contact adxproxy@microsoft.com directly for more info.
    【解决方案2】:

    Step 1 Connection String

    Build your connection string from this template:

    https://ade.applicationinsights.io/subscriptions/<subscription-id>/resourcegroups/<resource-group-name>/providers/microsoft.insights/components/<ai-app-name>

    Fill in the subscription-id, resource-group-name, and ai-app-name from the portal. Here is an example image

    Step 2 Add the connection to Kusto.Explorer

    Open Kusto.Explorer, choose Add Connection, and paste your connection string into the Cluster connection field.

    After you kit OK, Windows will prompt you to log in with your Azure Active Directory account. Once you have authenticated, Kusto.Explorer will display the Application Insights tables in the Connections panel.

    【讨论】:

    • What does it mean if I get 401 unauthorized error when I try to connect?
    • Solution works perfectly. @Arun, if you get a 401 it means that the AAD service principal (Azure account) you're using does not have access read access to the App Insights. You can see what AAD service principal you are using in Kusto Explorer in Connections->"Inspect Your AAD Principal", then on Azure you can go to the App Insights and give access to that AAD service principal.
    猜你喜欢
    • 2022-12-02
    • 2022-12-28
    • 2022-12-02
    • 2022-12-19
    • 2022-12-26
    • 2022-12-26
    • 2022-12-02
    • 1970-01-01
    • 2019-10-25
    相关资源
    最近更新 更多