turbot/azure_insights

Query: activedirectory_subscription_roles_for_user

Usage

powerpipe query azure_insights.query.activedirectory_subscription_roles_for_user

SQL

with subscription_roles as (
select
distinct a.scope as scope,
a.id as assignmnet_id,
d.role_name as role_name
from
azure_role_assignment as a
left join azure_role_definition as d on d.id = a.role_definition_id
where
a.principal_id = split_part($1, '/', 1)
order by
d.role_name
)
select
role_name as "Role Name",
scope as "Scope",
assignmnet_id as "Role Assignmnet ID"
from
subscription_roles
order by
role_name;

Dashboards

The query is used in the dashboards: