Unable to grant Graph API permission to Managed Identity Enterprise application

Chinmayi Bose 20 Reputation points
2025-09-02T10:18:31.31+00:00

Hi,

I am trying to grant Graph API permission to managed identity. I am following the below article to grant permissions.

https://techcommunity.microsoft.com/blog/integrationsonazureblog/grant-graph-api-permission-to-azure-automation-system-assigned-managed-identity/4278846

I understand it is a limitation to grant permission directly through Azure portal.

I ran the script from the above article, It was executed with the below warning as:

"WARNING: App roles found: 

Exception: 

Line |

   4 |      throw "Some App Roles are not found on Graph API service principa

     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

     | Some App Roles are not found on Graph API service principal"

However, I refreshed the permissions page in the enterprise application and there are no privileges listed.

I need to fix this to execute a runbook in Automation account.

Error in the runbook is as below:

"+ Connecting to Graph (Managed Identity) [Authorization_RequestDenied] : Insufficient privileges to complete the operation. "

Please advise.

Regards,

Chinmayi bose

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments

2 answers

Sort by: Most helpful
  1. Chinmayi Bose 20 Reputation points
    2025-09-18T13:37:32.17+00:00

    Hi Raja,

    I am using managed Identity in enterprise application so the above suggestion will not work for me.

    Could you help me on removing the permissions from the Graph Explorer(the one we added).

    Thank you,

    Chinmayi Bose

    Was this answer helpful?

    0 comments No comments

  2. Raja Pothuraju 47,730 Reputation points Microsoft Employee Moderator
    2025-09-02T13:48:58.0933333+00:00

    Hello Chinmayi Bose,

    Based on your description, I understand that you want to add API permissions to a system-assigned managed identity in your directory, where you only have the service principal object ID of that managed identity.

    Please follow the steps below to add Microsoft Graph API permissions to your Managed Identity Enterprise Application:

    1. Sign in to Graph explorerwith your Global Administrator account.
    2. Paste the following URL and select POST: https://graph.microsoft.com/v1.0/oauth2PermissionGrants
    3. Navigate to the Modify Permissions tab after pasting the above URL. Click Consent for the Directory.ReadWrite.All API permission.
      User's image
    4. Go back to the Request Body tab and paste the following JSON:
    {
       "clientId": "00001111-aaaa-2222-bbbb-3333cccc4444",  
       "consentType": "AllPrincipals",  
       "resourceId": "03be439e-65de-488e-8aae-2b148ad586d4",  
       "scope": "User.Read.All Group.Read.All"  
    }
    
    • clientId: Enter the Object ID of your Managed Identity Enterprise Application.
    • resourceId: This should be the Object ID of the Microsoft Graph first-party application. (The value provided above is correct; no changes are required.)
    • scope: Specify the list of API permissions you want to assign to the Enterprise Application.
    • After editing, click Run Query. You should receive a response similar to the screenshot provided.
      User's image
    • Once the request is successful, go to your Managed Identity Enterprise Application in the portal, open the Permissions tab, and verify that the permissions have been added.

    User's image

    Please refer the below document for more details on same steps.

    https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/grant-admin-consent?pivots=ms-graph#grant-admin-consent-for-delegated-permissions-using-microsoft-graph-api

    Was this answer helpful?


Your answer

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