Hello
Thanks for reaching out to Microsoft Q and A Forum ,
These instructions will help you identify the legacy roles and also help you in migrating:
- Navigate to the Azure Portal → Azure Active Directory, then go to Roles and administrators and search for roles marked as "Legacy". Use Microsoft Entra ID → Privileged Identity Management (PIM) to review role assignments.
- In Azure AD, navigate to Users → Directory role assignments and export role assignments via Microsoft Graph API or Azure PowerShell using:
Get-AzRoleAssignment | Where-Object { $_.RoleDefinitionName -like "*Legacy*" }
- Compare legacy roles with Microsoft Entra built-in roles (https://learn.microsoft.com/en-us/azure/role-based-access-control/rbac-and-directory-admin-roles?toc=%2Fentra%2Fidentity%2Frole-based-access-control%2FTOC.yml&bc=%2Fentra%2Fidentity%2Frole-based-access-control%2Fbreadcrumb%2Ftoc.yml ) and assign equivalent RBAC roles in Azure AD or Azure Subscription IAM.
- In Azure Portal, go to Access control (IAM) → Remove legacy role assignments. Use PowerShell to remove outdated roles:
Remove-AzRoleAssignment -ObjectId -RoleDefinitionName ""
I hope it was helpful, please don't forget to accept the answer if this was resolved your scenario.
Thanks