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
Copy file name to clipboardExpand all lines: sdk/monitor/Azure.Monitor.Query/README.md
+39-5Lines changed: 39 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,9 @@ The Azure Monitor Query client library is used to execute read-only queries agai
21
21
22
22
- An [Azure subscription][azure_subscription]
23
23
- A [TokenCredential](https://learn.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet) implementation, such as an [Azure Identity library credential type](https://learn.microsoft.com/dotnet/api/overview/azure/Identity-readme#credential-classes).
24
-
- To query Logs, you need an [Azure Log Analytics workspace][azure_monitor_create_using_portal].
24
+
- To query Logs, you need one of the following things:
25
+
- An [Azure Log Analytics workspace][azure_monitor_create_using_portal]
26
+
- An Azure resource of any kind (Storage Account, Key Vault, Cosmos DB, etc.)
25
27
- To query Metrics, you need an Azure resource of any kind (Storage Account, Key Vault, Cosmos DB, etc.).
26
28
27
29
### Install the package
@@ -104,21 +106,53 @@ All client instance methods are thread-safe and independent of each other ([guid
104
106
105
107
### Logs query
106
108
107
-
You can query logs using the `LogsQueryClient.QueryWorkspaceAsync` method. The result is returned as a table with a collection of rows:
109
+
You can query logs by workspace ID or resource ID. The result is returned as a table with a collection of rows.
110
+
111
+
**Workspace-centric logs query**
112
+
113
+
To query by workspace ID, use the [LogsQueryClient.QueryWorkspaceAsync](https://learn.microsoft.com/dotnet/api/azure.monitor.query.logsqueryclient.queryworkspaceasync) method:
To query by resource ID, use the [LogsQueryClient.QueryResourceAsync](https://learn.microsoft.com/dotnet/api/azure.monitor.query.logsqueryclient.queryresourceasync) method.
135
+
136
+
To find the resource ID:
137
+
138
+
1. Navigate to your resource's page in the Azure portal.
139
+
1. From the **Overview** blade, select the **JSON View** link.
140
+
1. In the resulting JSON, copy the value of the `id` property.
0 commit comments