unable to assign graph api permissions to managed identity

Nathan Carr 0 Reputation points
2025-03-31T15:42:05.94+00:00

We have a Data Factory instance with both a system and user assigned managed identity. We need these to be able to have the Group.Read.All Graph API permission and despite having Global Admin role, we are unable to assign this

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,482 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Pardha Saradhi Reddy Jaladi-MSFT 390 Reputation points Microsoft External Staff
    2025-04-07T20:39:09.2233333+00:00

    Hello Nathan Carr

    Thank you for reaching out to Microsoft Support!!

    The issue you're encountering arises because managed identities in Azure (both system-assigned and user-assigned) cannot directly be granted Microsoft Graph API permissions like Group.Read.All through the Azure portal. This is a known limitation, as managed identities are not treated the same as service principals when it comes to assigning Graph API permissions.

    You can submit this feature request using this support link, which will be monitored by Microsoft team and make the enhancements to Graph API.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

  2. Andy David - MVP 155K Reputation points MVP
    2025-04-07T21:16:57.69+00:00

    Assign with powershell:

    $managedIdentity = Get-MgServicePrincipal -ServicePrincipalId '<object id>'

    $graphSPN = Get-MgServicePrincipal -Filter "AppId eq '00000003-0000-0000-c000-000000000000'"

    #Add the needed perm

    $permission = "Group.Read.All"

    #find app role and type

    $appRole = $graphSPN.AppRoles |

    Where-Object Value -eq $permission |
    
    Where-Object AllowedMemberTypes -contains "Application"
    

    $bodyParam = @{

    PrincipalId = $managedIdentity.Id
    
    ResourceId  = $graphSPN.Id
    
    AppRoleId   = $appRole.Id
    

    }

    New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $managedIdentity.Id -BodyParameter $bodyParam

    0 comments No comments

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.