turbot/azure_insights

Query: compute_virtual_machine_network_interfaces

Usage

powerpipe query azure_insights.query.compute_virtual_machine_network_interfaces

SQL

with vm_interface as (
select
vm.public_ips as public_ips,
vm.private_ips as private_ips,
n ->> 'id' as network_id
from
azure_compute_virtual_machine as vm,
jsonb_array_elements(network_interfaces) as n
where
lower(id) = $1
and subscription_id = split_part($1, '/', 3)
)
select
i.name as "Name",
i.provisioning_state as "Provisioning State",
vi.public_ips as "Public IPs",
vi.private_ips as "Private IPs",
(ip_config -> 'properties' ->> 'primary')::boolean as "Primary IP Config",
ip_config -> 'properties' ->> 'privateIPAddressVersion' as "Private IP Version",
lower(i.id) as "Network Interface ID"
from
vm_interface vi
left join azure_network_interface as i on lower(i.id) = lower(vi.network_id)
left join jsonb_array_elements(i.ip_configurations) as ip_config on true;

Dashboards

The query is used in the dashboards: