Function: ResourcesCount()


Description

Count the number of Azure Resources for each subscription.

Query · kql

let ResourcesCount = () {
    arg("").Resources
    | summarize TotalResources = count() by subscriptionId
};
ResourcesCount()
Raw source Function: ResourcesCount() · KQL
Esc
Published by Bert-JanP/Hunting-Queries-Detection-Rules ↗, licensed under BSD 3-Clause ↗. Reproduced here unmodified.
# Function: ResourcesCount()

## Query Information

#### Description
Count the number of Azure Resources for each subscription.

#### References
- https://learn.microsoft.com/en-us/azure/governance/resource-graph/overview
- https://learn.microsoft.com/en-us/azure/governance/resource-graph/samples/starter?tabs=azure-portal

## Log Analytics (Sentinel)
```
let ResourcesCount = () {
    arg("").Resources
    | summarize TotalResources = count() by subscriptionId
};
ResourcesCount()
```


Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.