turbot/azure_insights

Query: compute_disk_associated_virtual_machine_details

Usage

powerpipe query azure_insights.query.compute_disk_associated_virtual_machine_details

SQL

(
select
name as "Name",
type as "Type",
lower(id) as "ID"
from
azure_compute_virtual_machine,
jsonb_array_elements(data_disks) as data_disk
where
lower(data_disk -> 'managedDisk' ->> 'id' ) = $1
and subscription_id = split_part($1, '/', 3)
)
union
(
select
name as "Name",
type as "Type",
lower(id) as "ID"
from
azure_compute_virtual_machine
where
lower(managed_disk_id) = $1
and subscription_id = split_part($1, '/', 3)
)

Dashboards

The query is used in the dashboards: