Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
// Azure Resource Graph Query
// Find all single instance VMs that have an attached disk that is not in the Premium or Ultra sku tier.

resources
| where type =~ 'Microsoft.Compute/virtualMachines'
| where isnull(properties.virtualMachineScaleSet.id)
| where isnotnull(properties.availabilitySet)
| extend lname = tolower(name)
| join kind=leftouter(resources
| where type =~ 'Microsoft.Compute/disks'
| where not(sku.tier =~ 'Premium') and not(sku.tier =~ 'Ultra')
| extend lname = tolower(tostring(split(managedBy, '/')[8]))
| project lname, name
| summarize disks = make_list(name) by lname) on lname
| where isnotnull(disks)
| project recommendationId = "b60ae773-9917-4bca-8a42-7cb45365a917", name, id, tags, param1=strcat("AffectedDisks: ", disks)
// under-development