turbot/steampipe-mod-azure-insights

Query: activedirectory_directory_roles_for_activedirectory_user

Usage

powerpipe query azure_insights.query.activedirectory_directory_roles_for_activedirectory_user

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_user as au on au.id = r.m_id
where
r.tenant_id = au.tenant_id
and au.id = split_part($1, '/', 1);