turbot/azure_insights

Query: compute_virtual_machines_for_compute_disk

Usage

powerpipe query azure_insights.query.compute_virtual_machines_for_compute_disk

SQL

select
lower(m.id) as virtual_machine_id
from
azure_compute_virtual_machine as m,
jsonb_array_elements(data_disks) as data_disk
where
lower(data_disk -> 'managedDisk' ->> 'id') = lower($1)
or lower(m.managed_disk_id) = $1
and subscription_id = split_part($1, '/', 3);