turbot/azure_insights

Query: compute_virtual_machine_scale_set_by_logging_status

Usage

powerpipe query azure_insights.query.compute_virtual_machine_scale_set_by_logging_status

SQL

with logging_details as (
select
distinct a.id as vm_scale_set_id
from
azure_compute_virtual_machine_scale_set as a,
jsonb_array_elements(extensions) as b
where
(b ->> 'Publisher' = 'Microsoft.Azure.Diagnostics'
and b ->> 'ExtensionType' = 'IaaSDiagnostics'
or
(b ->> 'Publisher' = any(ARRAY ['Microsoft.OSTCExtensions', 'Microsoft.Azure.Diagnostics']))
and b ->> 'ExtensionType' = 'LinuxDiagnostic')
)
select
set_id,
count(*)
from (
select b.vm_scale_set_id,
case when b.vm_scale_set_id is not null then
'enabled'
else
'disabled'
end set_id
from
azure_compute_virtual_machine_scale_set as a
left join logging_details as b on a.id = b.vm_scale_set_id) as vmss
group by
set_id
order by
set_id;

Dashboards

The query is used in the dashboards: