turbot/azure_insights

Query: network_public_ip_association_details

Usage

powerpipe query azure_insights.query.network_public_ip_association_details

SQL

with network_interface_public_ip as (
select
id,
title,
type,
jsonb_array_elements(ip_configurations)->'properties'->'publicIPAddress'->>'id' as pid
from
azure_network_interface
), public_ip_api_management as (
select
id,
title,
type,
jsonb_array_elements_text(public_ip_addresses) as pid
from
azure_api_management
)
-- Network Interface
select
n.title as "Title",
n.type as "Type",
n.id as "ID",
null as link
from
network_interface_public_ip as n
left join azure_public_ip as p on lower(n.pid) = lower(p.id)
where
lower(p.id) = $1
and subscription_id = split_part($1, '/', 3)
-- API Management
union all
select
a.title as "Title",
a.type as "Type",
a.id as "ID",
null as link
from
public_ip_api_management as a
left join azure_public_ip as p on (a.pid)::inet = p.ip_address
where
lower(p.id) = $1
and subscription_id = split_part($1, '/', 3);

Dashboards

The query is used in the dashboards: