turbot/azure_insights

Query: activedirectory_groups_for_activedirectory_user

Usage

powerpipe query azure_insights.query.activedirectory_groups_for_activedirectory_user

SQL

with group_details as(
select
id as id,
title as title,
tenant_id as tenant_id,
jsonb_array_elements_text(member_ids) as m_id
from
azuread_group
)
select
ag.id || '/' || ag.tenant_id as activedirectory_group_id
from
group_details as ag
left join azuread_user as au on au.id = ag.m_id
where
ag.tenant_id = au.tenant_id
and au.id = split_part($1, '/', 1);