turbot/azure_insights

Query: subscriptions_for_activedirectory_group

Usage

powerpipe query azure_insights.query.subscriptions_for_activedirectory_group

SQL

select
distinct d.subscription_id as subscription_id
from
azuread_group as g
left join azure_role_assignment as a on a.principal_id = G.id
left join azure_role_definition as d on d.id = a.role_definition_id
where
a.scope like '/subscriptions/%'
and d.id is not null
and g.id = split_part($1, '/', 1)
and g.tenant_id = split_part($1, '/', 2);