turbot/steampipe-mod-azure-insights

Query: activedirectory_directory_roles_for_activedirectory_group

Usage

powerpipe query azure_insights.query.activedirectory_directory_roles_for_activedirectory_group

SQL

with assigned_role as(
select
id as id,
title as title,
tenant_id as tenant_id,
jsonb_array_elements_text(member_ids) as m_id
from
azuread_directory_role
)
select
r.id || '/' || r.tenant_id as directory_role_id
from
assigned_role as r
left join azuread_group as g on g.id = r.m_id
where
r.tenant_id = g.tenant_id
and g.id = split_part($1, '/', 1);