Loading...

Announcing AuthorizationResources in Azure Resource Graph

Announcing AuthorizationResources in Azure Resource Graph

We are excited to announce support for Azure RBAC resources in Azure Resource Graph (ARG) via the AuthorizationResources table! You can query your Role Assignments, Role Definitions, and Classic Admins resources. With this table, you’ll be able to quickly answer questions such ashow many users are using a role definition?” or how many role assignments are used?” or how many role definitions are used?”. Then, you can act on the results to clean up unused role definitions, remove redundant role assignments, or optimize your existing role assignments using AAD Groups. With Classic Admins set to be deprecated in August 2024, you can leverage ARG to convert Classic Admins to Role Assignments. We’ve shared scenarios and queries below to get started! You can try these queries out in the Azure Portal via the Resource Graph Explorer (tutorial).

 

This is just the first part of our AuthorizationResources journey. We want to build features to make your security, compliance, and audit scenarios possible, which is why we’d greatly appreciate your feedback and collaboration opportunity here. We look forward to working with you as we build out AuthorizationResources capabilities.


Scenario 1: Getting Started

You can use the AuthorizationResources table to understand how many users/service principals are using each RoleDefinition. The query below does that and serves as a starting point to understand the schema of AuthorizationResources so you can explore its potential.

 

AuthorizationResources | where type =~ 'microsoft.authorization/roleassignments' | extend principalType = tostring(properties['principalType']) | extend principalId = tostring(properties['principalId']) | extend roleDefinitionId = tolower(tostring(properties['roleDefinitionId'])) | join kind=inner ( AuthorizationResources | where type =~ 'microsoft.authorization/roledefinitions' | extend id = tolower(id) ) on $left.roleDefinitionId == $right.id | summarize count() by roleDefinitionId, principalType | where count_ > 1 | sort by count_ desc

 

 

Scenario 2: Cleaning Up Redundant Role Assignments

Azure supports up to 4000 role assignments per subscription. If you have hit the ‘No more role assignments can be created (code: RoleAssignmentLimitExceeded) we recommend using the two-part queries below to remove role assignments. These queries will allow you to determine where you can replace multiple role assignments with a single role assignment, using a higher scope or a security group. You can see the detailed tutorial on how to do this here.

 

Scenario 3: Cleaning Up Unused Role Definitions

Additionally, Azure supports up to 5000 custom roles in a directory. If you have hit the ‘Role definition limit exceeded. No more role definitions can be created (code: RoleDefinitionLimitExceeded)’ we recommend using the query below to determine role definitions with no role assignments, rendering these removable. You can see a detailed step-by-step tutorial on this scenario here.

 

AuthorizationResources | where type =~ "microsoft.authorization/roledefinitions" | where tolower(properties.type) == "customrole" | extend rdId = tolower(id) | extend Scope = tolower(properties.assignableScopes) | join kind = leftouter ( AuthorizationResources | where type =~ "microsoft.authorization/roleassignments" | extend RoleId = tolower(tostring(properties.roleDefinitionId)) | summarize RoleAssignmentCount = count() by RoleId ) on $left.rdId == $right.RoleId | where isempty(RoleAssignmentCount) | project RoleDefinitionId = rdId, RoleDefinitionName = tostring(properties.roleName), Scope

 

 

More information about Azure RBAC limits can be found here.

 

Thank you, and happy querying!

Published on:

Learn more
Azure Governance and Management Blog articles
Azure Governance and Management Blog articles

Azure Governance and Management Blog articles

Share post:

Related posts

Azure Landing Zones - Policy Refresh Q1 FY25

ALZ - Policy Refresh Q1 FY25 is here! As you may be aware, the ALZ team release cadence is now on quarterly basis to help customers and partne...

1 year ago

Custom Policy- Reusable Logs Templates

Reusable Templates for Sending Logs to Log Analytics Workspace   Challenge:   When it comes to developing custom policies for sendin...

1 year ago

Enhancements to Azure Monitor Baseline Alerts for Azure Landing Zones

Introduction   Welcome to our latest blog post where we dive into a number of exciting new key updates, highlight the new portal accelera...

1 year ago

Introducing the Azure Policy Community Repo

Introducing the Azure Policy Community Repo   What is the Azure Policy Community Repo? The Azure Policy Community Repo is a collaborativ...

2 years ago

General Availability: Vaulted backups for Azure Blob Storage

We are excited to announce the general availability of vaulted backups for Azure Blob Storage. Vaulted backups can help you achieve complete p...

2 years ago

Azure Update Manager to support CIS hardened images among other images

What’s coming in by end of July 2024: Azure Update Manager will add support for 35 CIS hardened images. This is the first time that Update Man...

2 years ago

Mastering your cloud journey: Essentials to Innovating, Migrating and Modernizing, on Azure

We are living during a time of rapid growth in AI technologies and seeing cloud complexity increase as a result of those advanced workloads, w...

2 years ago

Public Preview Announcement: Azure Policy Built-in Versioning

Welcome to a new era of policy management, where policy definitions are more agile, adaptable, and accessible than ever before! We are thrille...

2 years ago

Announcing Azure Monitoring Agent support in Azure Landing Zones

Introduction   Hello and welcome to another blog post about Azure Landing Zones, the best practice framework for accelerating your cloud...

2 years ago

Announcing the General Availability of Change Actor

Change Analysis  Identifying who made a change to your Azure resources and how the change was made just became easier! With Change Analys...

2 years ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.