turbot/steampipe-mod-azure-insights

Query: compute_virtual_machine_scale_sets_for_network_load_balancer

Usage

powerpipe query azure_insights.query.compute_virtual_machine_scale_sets_for_network_load_balancer

SQL

select
lower(vm_scale_set.id) as compute_virtual_machine_scale_set_id
from
azure_compute_virtual_machine_scale_set as vm_scale_set,
jsonb_array_elements(virtual_machine_network_profile -> 'networkInterfaceConfigurations') as p,
jsonb_array_elements(p -> 'properties' -> 'ipConfigurations') as c,
jsonb_array_elements(c -> 'properties' -> 'loadBalancerBackendAddressPools') as b
where
lower(split_part( b ->> 'id', '/backendAddressPools' , 1)) = $1
and vm_scale_set.subscription_id = split_part($1, '/', 3)