You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Cross-resource query Azure Data Explorer by using Azure Monitor
3
-
description: Use Azure Monitor to perform cross-product queries between Azure Data Explorer, Log Analytics workspaces, and classic Application Insights applications in Azure Monitor.
2
+
title: Query data in Azure Data Explorer and Azure Resource Graph from Azure Monitor
3
+
description: Query data in Azure Data Explorerand Azure Resource Graph from Azure Monitor.
4
4
author: guywi-ms
5
5
ms.author: guywild
6
6
ms.topic: conceptual
7
-
ms.date: 07/25/2023
7
+
ms.date: 08/22/2023
8
8
ms.reviewer: osalzberg
9
9
10
10
---
11
-
# Cross-resource query Azure Data Explorer by using Azure Monitor
12
-
Azure Monitor supports cross-service queries between Azure Data Explorer, [Application Insights](../app/app-insights-overview.md), and [Log Analytics](../logs/data-platform-logs.md). You can then query your Azure Data Explorer cluster by using Log Analytics or Application Insights tools and refer to it in a cross-service query. This article shows how to make a cross-service query.
11
+
# Query data in Azure Data Explorer and Azure Resource Graph from Azure Monitor
12
+
Azure Monitor lets you query data in [Azure Data Explorer](/azure/data-explorer/data-explorer-overview) and [Azure Resource Graph](../../governance/resource-graph/overview.md) from your Log Analytics workspace and Application Insights resources. This article explains how to query data in Azure Resource Graph and Azure Data Explorer from Azure Monitor.
13
13
14
-
The following diagram shows the Azure Monitor cross-service flow:
14
+
You can run cross-service queries by using any client tools that support Kusto Query Language (KQL) queries, including the Log Analytics web UI, workbooks, PowerShell, and the REST API.
15
15
16
-
:::image type="content" source="media\azure-data-explorer-monitor-proxy\azure-monitor-data-explorer-flow.png" alt-text="Diagram that shows the flow of queries between a user, Azure Monitor, a proxy, and Azure Data Explorer.":::
16
+
## Permissions required
17
17
18
-
## Cross query your Log Analytics or Application Insights resources and Azure Data Explorer
18
+
To run a cross-service query, you need:
19
19
20
-
You can run cross-resource queries by using client tools that support Kusto queries. Examples of these tools include the Log Analytics web UI, workbooks, PowerShell, and the REST API.
21
-
22
-
Enter the identifier for an Azure Data Explorer cluster in a query within the `adx` pattern, followed by the database name and table.
:::image type="content" source="media/azure-data-explorer-monitor-proxy/azure-monitor-cross-service-query-example.png" alt-text="Screenshot that shows an example of a cross-service query.":::
28
-
29
-
> [!NOTE]
30
-
>* Database names are case sensitive.
31
-
>* Cross-resource query as an alert isn't supported.
32
-
>* Identifying the Timestamp column in the cluster isn't supported. The Log Analytics Query API won't pass along the time filter.
33
-
> * The cross-service query ability is used for data retrieval only. For more information, see [Function supportability](#function-supportability).
34
-
> * Private Link is not supported with this feature.
20
+
-`Microsoft.OperationalInsights/workspaces/query/*/read` permissions to the Log Analytics workspaces you query, as provided by the [Log Analytics Reader built-in role](../logs/manage-access.md#log-analytics-reader), for example.
21
+
- Reader permissions to the resources you query in Azure Resource Graph.
22
+
- Viewer permissions to the tables you query in Azure Data Explorer.
35
23
36
24
## Function supportability
37
25
38
-
The Azure Monitor cross-service queries support functions for Application Insights, Log Analytics, and Azure Data Explorer.
39
-
This capability enables cross-cluster queries to reference an Azure Monitor or Azure Data Explorer tabular function directly.
26
+
Azure Monitor cross-service queries support functions for Application Insights, Log Analytics, Azure Data Explorer, and Azure Resource Graph.
27
+
This capability enables cross-cluster queries to reference an Azure Monitor, Azure Data Explorer, or Azure Resource Graph tabular function directly.
40
28
The following commands are supported with the cross-service query:
41
29
42
30
*`.show functions`
43
31
*`.show function {FunctionName}`
44
32
*`.show database {DatabaseName} schema as json`
45
33
46
-
## Combine Azure Data Explorer cluster tables with a Log Analytics workspace
34
+
## Query data in Azure Data Explorer
35
+
36
+
Enter the identifier for an Azure Data Explorer cluster in a query within the `adx` pattern, followed by the database name and table.
### Combine Azure Data Explorer cluster tables with a Log Analytics workspace
47
42
48
43
Use the `union` command to combine cluster tables with a Log Analytics workspace.
49
44
45
+
For example:
46
+
50
47
```kusto
51
48
union customEvents, adx('https://help.kusto.windows.net/Samples').StormEvents
52
49
| take 10
@@ -55,19 +52,20 @@ union customEvents, adx('https://help.kusto.windows.net/Samples').StormEvents
55
52
let CL1 = adx('https://help.kusto.windows.net/Samples').StormEvents;
56
53
union customEvents, CL1 | take 10
57
54
```
58
-
:::image type="content" source="media/azure-data-explorer-monitor-proxy/azure-monitor-union-cross-query.png" alt-text="Screenshot that shows a cross-service query example with the union command.":::
59
55
60
56
> [!TIP]
61
57
> Shorthand format is allowed: *ClusterName*/*InitialCatalog*. For example, `adx('help/Samples')` is translated to `adx('help.kusto.windows.net/Samples')`.
62
58
63
-
When you use the [`join` operator](/azure/data-explorer/kusto/query/joinoperator) instead of union, you're required to use a [`hint`](/azure/data-explorer/kusto/query/joinoperator#join-hints) to combine the data in the Azure Data Explorer cluster with the Log Analytics workspace. Use `Hint.remote={Direction of the Log Analytics Workspace}`. For example:
59
+
When you use the [`join` operator](/azure/data-explorer/kusto/query/joinoperator) instead of union, you're required to use a [`hint`](/azure/data-explorer/kusto/query/joinoperator#join-hints) to combine the data in the Azure Data Explorer cluster with the Log Analytics workspace. Use `Hint.remote={Direction of the Log Analytics Workspace}`.
60
+
61
+
For example:
64
62
65
63
```kusto
66
64
AzureDiagnostics
67
65
| join hint.remote=left adx("cluster=ClusterURI").AzureDiagnostics on (ColumnName)
68
66
```
69
67
70
-
## Join data from an Azure Data Explorer cluster in one tenant with an Azure Monitor resource in another
68
+
###Join data from an Azure Data Explorer cluster in one tenant with an Azure Monitor resource in another
71
69
72
70
Cross-tenant queries between the services aren't supported. You're signed in to a single tenant for running the query that spans both resources.
73
71
@@ -76,13 +74,59 @@ If the Azure Data Explorer resource is in Tenant A and the Log Analytics workspa
76
74
* Use Azure Data Explorer to add roles for principals in different tenants. Add your user ID in Tenant B as an authorized user on the Azure Data Explorer cluster. Validate that the [TrustedExternalTenant](/powershell/module/az.kusto/update-azkustocluster) property on the Azure Data Explorer cluster contains Tenant B. Run the cross query fully in Tenant B.
77
75
* Use [Lighthouse](../../lighthouse/index.yml) to project the Azure Monitor resource into Tenant A.
78
76
79
-
## Connect to Azure Data Explorer clusters from different tenants
77
+
###Connect to Azure Data Explorer clusters from different tenants
80
78
81
79
Kusto Explorer automatically signs you in to the tenant to which the user account originally belongs. To access resources in other tenants with the same user account, you must explicitly specify `TenantId` in the connection string:
Enter the `arg("")` pattern, followed by the Azure Resource Graph table name.
86
+
87
+
`arg(״״).<Azure-Resource-Graph-table-name>`
88
+
89
+
90
+
For example:
91
+
92
+
```kusto
93
+
arg("").<Azure-Resource-Graph-table-name>
94
+
```
95
+
96
+
### Combine Azure Resource Graph tables with a Log Analytics workspace
97
+
98
+
Use the `union` command to combine cluster tables with a Log Analytics workspace.
99
+
100
+
For example:
101
+
102
+
```kusto
103
+
union AzureActivity, arg("").Resources
104
+
| take 10
105
+
```
106
+
```kusto
107
+
let CL1 = arg("").Resources ;
108
+
union AzureActivity, CL1 | take 10
109
+
```
110
+
111
+
When you use the [`join` operator](/azure/data-explorer/kusto/query/joinoperator) instead of union, you're required to use a [`hint`](/azure/data-explorer/kusto/query/joinoperator#join-hints) to combine the data in Azure Resource Graph with the Log Analytics workspace. Use `Hint.remote={Direction of the Log Analytics Workspace}`. For example:
112
+
113
+
```kusto
114
+
Perf | where ObjectName == "Memory" and (CounterName == "Available MBytes Memory")
| join hint.remote=left (arg("").Resources | where type =~ 'Microsoft.Compute/virtualMachines' | project _ResourceId=id, tags) on _ResourceId | project-away _ResourceId1 | where tostring(tags.env) == "prod"
117
+
```
118
+
119
+
## Create an alert based on a cross-service query
120
+
121
+
To create a new alert rule based on a cross-service query, follow the steps in [Create a new alert rule](../alerts/alerts-create-new-alert-rule.md), selecting your Log Analytics workspace on the Scope tab.
122
+
123
+
## Limitations
124
+
125
+
* Database names are case sensitive.
126
+
* Identifying the Timestamp column in the cluster isn't supported. The Log Analytics Query API won't pass along the time filter.
127
+
* The cross-service query ability is used for data retrieval only.
128
+
*[Private Link](../logs/private-link-security.md) does not support cross-service queries.
Copy file name to clipboardExpand all lines: articles/sentinel/livestream.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ You can create a livestream session from an existing hunting query, or create yo
50
50
- If you started livestream from scratch, create your query.
51
51
52
52
> [!NOTE]
53
-
> Livestream supports **cross-resource queries** of data in Azure Data Explorer. [**Learn more about cross-resource queries**](../azure-monitor/logs/azure-monitor-data-explorer-proxy.md#cross-query-your-log-analytics-or-application-insights-resources-and-azure-data-explorer).
53
+
> Livestream supports **cross-resource queries** of data in Azure Data Explorer. [**Learn more about cross-resource queries**](../azure-monitor/logs/azure-monitor-data-explorer-proxy.md).
0 commit comments