turbot/azure_insights

Query: activedirectory_users_for_activedirectory_group

Usage

powerpipe query azure_insights.query.activedirectory_users_for_activedirectory_group

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
au.id || '/' || au.tenant_id as activedirectory_user_id
from
group_details as ag
left join azuread_user as au on ag.m_id = au.id
where
au.id is not null
and ag.id = split_part($1, '/', 1)
and ag.tenant_id = split_part($1, '/', 2);