turbot/azure_insights

Query: network_virtual_networks_for_sql_server

Usage

powerpipe query azure_insights.query.network_virtual_networks_for_sql_server

SQL

select
lower(id) as virtual_networks_id
from
azure_virtual_network,
jsonb_array_elements(subnets) as sub
where
lower(sub ->> 'id') in (
select
lower(vnr -> 'properties' ->> 'virtualNetworkSubnetId')
from
azure_sql_server,
jsonb_array_elements(virtual_network_rules) as vnr
where
lower(id) = $1
and subscription_id = split_part($1, '/', 3)
);