Discover and Query Workspace
A 3-step recipe with Azure Log Analytics. We can help you get access.
Recipe · 3 steps
Discover and Query Workspace
with Azure Log Analytics
List subscription workspaces, resolve one, and run a KQL query against it.
- List all Log Analytics workspaces in the subscription to confirm the target workspace is present before resolving it.
- Read the management record for the chosen workspace to obtain its customer (workspace) ID and provisioning state.
- Execute the KQL query against the resolved workspace using the Log Analytics query endpoint and return the tabular results.
What you'll need to have ready
- subscriptionId: The ID of the target Azure subscription.
- resourceGroupName: The resource group that contains the workspace.
- workspaceName: The management name of the Log Analytics workspace.
- workspaceId: The customer (workspace) GUID used by the query endpoint.
- query: The KQL query to execute (e.g. AzureActivity | summarize count() by Category).
- timespan: Optional ISO 8601 duration limiting the query window (e.g. P1D).
- managementApiVersion: The management API version to use.
For your developer
Arazzo workflow azure-log-analytics:discover-and-query-workspace, 3 operations: listWorkspaces → getWorkspace → postQuery. Specs on APIs.io.