turbot/azure_insights

Query: compute_disks_for_compute_virtual_machine

Usage

powerpipe query azure_insights.query.compute_disks_for_compute_virtual_machine

SQL

select
lower(jsonb_array_elements(data_disks)->'managedDisk'->>'id') as disk_id
from
azure_compute_virtual_machine
where
lower(id) = $1
union
select
lower(d.id) as disk_id
from
azure_compute_virtual_machine as vm
left join azure_compute_disk as d on lower(d.managed_by) = lower(vm.id)
where
lower(vm.id) = $1
and vm.subscription_id = split_part($1, '/', 3);