Query Details

Workspace I Ds

Query

//Run the following in Azure Resource Graph Explorer to show all Workspace IDs. From LucyIsOpal (https://twitter.com/LucyIsOpal)

resources
| where type == "microsoft.operationalinsights/workspaces"
| where properties['retentionInDays'] == "90"
| project properties['customerId']

Explanation

This query is used to find all the Workspace IDs for Microsoft Operational Insights workspaces with a retention period of 90 days. It then projects the customer ID for each workspace.

Details

Rod Trent profile picture

Rod Trent

Released: April 18, 2023

Tables

resources

Keywords

Resources,Microsoft.OperationalInsights/Workspaces,Properties,RetentionInDays,Project,CustomerId

Operators

wheretype=="microsoft.operationalinsights/workspaces"properties['retentionInDays']project['customerId']

Actions