For exporting subscription-level role assignments with full principal details, there are two supported approaches in the provided material: using the Azure portal for Azure RBAC roles and using Microsoft Entra ID for directory roles. Both avoid the continuous access evaluation issue seen in custom scripts.
- Export Azure RBAC role assignments per subscription in the Azure portal
This gives all role assignments (built‑in and custom) at a chosen scope, including users, groups, and service principals.
Steps:
- In the Azure portal, go to All services and select the scope:
- Subscriptions → choose the subscription whose assignments are needed.
- Open the subscription and select Access control (IAM).
- Select Download role assignments to open the download pane.
- Choose which assignments to include:
- Inherited – include assignments inherited from higher scopes.
- At current scope – include assignments defined directly on the subscription.
- Children – include assignments on child resource groups and resources.
- Select file format CSV (best for analysis) or JSON.
- Provide a file name and select Start.
The CSV/JSON output contains, for each assignment:
- Role definition
- Scope
- Principal information (user, group, or service principal)
- Additional metadata
If directory read permissions are missing (for example, no Directory Readers role), the DisplayName, SignInName, and ObjectType columns will be blank; in that case, grant appropriate directory read permissions and re-export.
Repeat this for each subscription in the tenant to build a complete inventory of subscription-level Azure RBAC assignments.
- Export Microsoft Entra role assignments (directory roles)
If the requirement also includes Microsoft Entra directory roles (Global Administrator, etc.), these can be exported centrally.
To export all active directory role assignments across all roles:
- In the Microsoft Entra admin center, go to Entra ID → Roles & admins.
- On Roles and administrators, select All roles.
- Select Download assignments.
- Specify a file name and select Start bulk operation.
A CSV file is downloaded listing all role assignments at all scopes for all directory roles, including the assigned user, group, or service principal.
To export assignments for a single directory role:
- On Roles and administrators, select the specific role.
- Select Download assignments (or Export if using PIM experience).
- A CSV file is downloaded listing all assignments for that role at all scopes.
- Export user and group assignments to service principals (enterprise apps)
For a tenant-wide view of which users and groups are assigned to enterprise applications (service principals), Microsoft Entra PowerShell can export this to CSV:
- Connect with sufficient permissions (for example, Cloud Application Administrator):
Connect-Entra -Scopes 'Directory.Read.All', 'Application.Read.All'
- Run the documented script that:
- Retrieves all service principals.
- Collects user and group assignments for each service principal.
- Exports to CSV with service principal name, assigned users, and assigned groups.
This complements the Azure RBAC export by giving application assignment details for all service principals in the tenant.
Using these built-in export capabilities avoids the continuous access evaluation challenges that can interrupt long-running custom scripts and provides the requested mapping of subscriptions to role assignments and principals (users, groups, and service principals).
References: