turbot/azure_compliance

Query: application_insights_linked_to_log_analytics_workspace

Usage

powerpipe query azure_compliance.query.application_insights_linked_to_log_analytics_workspace

SQL

select
a.id as resource,
case
when type = 'microsoft.insights/components' and workspace_resource_id is not null then 'ok'
else 'alarm'
end as status,
case
when type = 'microsoft.insights/components' and workspace_resource_id is not null then a.name || ' linked to log analytics workspace.'
else a.name || ' not linked to log analytics workspace.'
end as reason
, a.resource_group as resource_group
, sub.display_name as subscription
from
azure_application_insight as a
left join azure_subscription sub on sub.subscription_id = a.subscription_id;

Controls

The query is being used by the following controls: