Skip to content

Commit 6e72692

Browse files
Merge pull request #248387 from v-jbasden/v-jbasden-logs-content-inventory-line-8
Authoring new guidance on the permissions required to create a log query across multiple workspaces and apps, adding conceptual tabs, and streamlining the content
2 parents 2adf637 + ad53ea6 commit 6e72692

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

articles/azure-monitor/logs/cross-workspace-query.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,22 @@ There are two methods to query data that's stored in multiple workspaces and app
2222
> [!IMPORTANT]
2323
> If you're using a [workspace-based Application Insights resource](../app/create-workspace-resource.md), telemetry is stored in a Log Analytics workspace with all other log data. Use the `workspace()` expression to write a query that includes applications in multiple workspaces. For multiple applications in the same workspace, you don't need a cross-workspace query.
2424
25+
## Permissions required
26+
27+
- You must have `Microsoft.OperationalInsights/workspaces/query/*/read` permissions to the Log Analytics workspaces you query, as provided by the [Log Analytics Reader built-in role](./manage-access.md#log-analytics-reader), for example.
28+
- To save a query, you must have `microsoft.operationalinsights/querypacks/queries/action` permisisons to the query pack where you want to save the query, as provided by the [Log Analytics Contributor built-in role](./manage-access.md#log-analytics-contributor), for example.
29+
2530
## Cross-resource query limits
2631

2732
* The number of Application Insights components and Log Analytics workspaces that you can include in a single query is limited to 100.
2833
* Cross-resource queries in log alerts are only supported in the current [scheduledQueryRules API](/rest/api/monitor/scheduledqueryrule-2018-04-16/scheduled-query-rules). If you're using the legacy Log Analytics Alerts API, you'll need to [switch to the current API](../alerts/alerts-log-api-switch.md).
29-
* References to a cross resource, such as another workspace, should be explicit and can't be parameterized. See [Identify workspace resources](#identify-workspace-resources) for examples.
34+
* References to a cross resource, such as another workspace, should be explicit and can't be parameterized. See [Gather identifiers for Log Analytics workspaces](?tabs=workspace-identifier#gather-identifiers-for-log-analytics-workspaces-and-application-insights-resources) for examples.
35+
36+
## Gather identifiers for Log Analytics workspaces and Application Insights resources
3037

31-
## Query across Log Analytics workspaces and from Application Insights
3238
To reference another workspace in your query, use the [workspace](../logs/workspace-expression.md) identifier. For an app from Application Insights, use the [app](./app-expression.md) identifier.
3339

34-
### Identify workspace resources
40+
### [Workspace identifier](#tab/workspace-identifier)
3541

3642
You can identify a workspace using one of these IDs:
3743

@@ -47,7 +53,7 @@ You can identify a workspace using one of these IDs:
4753
workspace("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ContosoAzureHQ/providers/Microsoft.OperationalInsights/workspaces/contosoretail-it").Update | count
4854
```
4955
50-
### Identify an application
56+
### [App identifier](#tab/app-identifier)
5157
The following examples return a summarized count of requests made against an app named *fabrikamapp* in Application Insights.
5258
5359
You can identify an app using one of these IDs:
@@ -64,7 +70,13 @@ You can identify an app using one of these IDs:
6470
app("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/Fabrikam/providers/microsoft.insights/components/fabrikamapp").requests | count
6571
```
6672
67-
### Perform a query across multiple resources
73+
---
74+
75+
## Query across Log Analytics workspaces and from Application Insights
76+
77+
Follow the instructions in this section to query without using a function or by using a function.
78+
79+
### Query without using a function
6880
You can query multiple resources from any of your resource instances. These resources can be workspaces and apps combined.
6981
7082
Example for a query across three workspaces:
@@ -79,7 +91,9 @@ union
7991
| summarize dcount(Computer) by Classification
8092
```
8193
82-
## Use a cross-resource query for multiple resources
94+
For more information on the union, where, and summarize operators, see [union operator](/azure/data-explorer/kusto/query/unionoperator), [where operator](/azure/data-explorer/kusto/query/summarizeoperator), and [summarize operator](/azure/data-explorer/kusto/query/summarizeoperator).
95+
96+
### Query by using a function
8397
When you use cross-resource queries to correlate data from multiple Log Analytics workspaces and Application Insights components, the query can become complex and difficult to maintain. You should make use of [functions in Azure Monitor log queries](./functions.md) to separate the query logic from the scoping of the query resources. This method simplifies the query structure. The following example demonstrates how you can monitor multiple Application Insights components and visualize the count of failed requests by application name.
8498
8599
Create a query like the following example that references the scope of Application Insights components. The `withsource= SourceApp` command adds a column that designates the application name that sent the log. [Save the query as a function](./functions.md#create-a-function) with the alias `applicationsScoping`.

articles/azure-monitor/logs/move-workspace-region.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ The following procedures show how to prepare the workspace and resources for the
292292
| summarize max(TimeGenerated) by Type
293293
```
294294
295-
After data sources are connected to the target workspace, ingested data is stored in the target workspace. Older data stays in the original workspace and is subject to the retention policy. You can perform a [cross-workspace query](./cross-workspace-query.md#perform-a-query-across-multiple-resources). If both workspaces were assigned the same name, use a qualified name (*subscriptionName/resourceGroup/componentName*) in the workspace reference.
295+
After data sources are connected to the target workspace, ingested data is stored in the target workspace. Older data stays in the original workspace and is subject to the retention policy. You can perform a [cross-workspace query](./cross-workspace-query.md). If both workspaces were assigned the same name, use a qualified name (*subscriptionName/resourceGroup/componentName*) in the workspace reference.
296296
297297
Here's an example for a query across two workspaces that have the same name:
298298
@@ -317,7 +317,7 @@ If you want to discard the source workspace, delete the exported resources or th
317317

318318
## Clean up
319319

320-
While new data is being ingested to your new workspace, older data in the original workspace remains available for query and is subject to the retention policy defined in the workspace. We recommend that you keep the original workspace for as long as you need older data to [query across](./cross-workspace-query.md#perform-a-query-across-multiple-resources) workspaces.
320+
While new data is being ingested to your new workspace, older data in the original workspace remains available for query and is subject to the retention policy defined in the workspace. We recommend that you keep the original workspace for as long as you need older data to [query across](./cross-workspace-query.md) workspaces.
321321

322322
If you no longer need access to older data in the original workspace:
323323

articles/azure-monitor/logs/query-optimization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ A query that spans more than five workspaces is considered a query that consumes
455455

456456
> [!IMPORTANT]
457457
> - In some multi-workspace scenarios, the CPU and data measurements won't be accurate and will represent the measurement of only a few of the workspaces.
458-
> - Cross workspace queries having an explicit identifier: workspace ID, or workspace Azure Resource ID, consume less resources and are more performant. See [Create a log query across multiple workspaces](./cross-workspace-query.md#identify-workspace-resources)
458+
> - Cross workspace queries having an explicit identifier: workspace ID, or workspace Azure Resource ID, consume less resources and are more performant. See [Gather identifiers for Log Analytics workspaces](./cross-workspace-query.md?tabs=workspace-identifier#gather-identifiers-for-log-analytics-workspaces-and-application-insights-resources)
459459
460460
## Parallelism
461461
Azure Monitor Logs uses large clusters of Azure Data Explorer to run queries. These clusters vary in scale and potentially get up to dozens of compute nodes. The system automatically scales the clusters according to workspace placement logic and capacity.

0 commit comments

Comments
 (0)