unable to provide consent

Glenn Maxwell 10,731 Reputation points
2024-07-05T22:55:59.85+00:00

Hi All,

I am facing an issue with API permissions. I have an Azure App Registration with the following Microsoft Graph API permissions. Let's say the App Registration name is TESTAPP and the Client ID is xxxx-xxxx-xxxxx-xxxxx.

permms

I have a SharePoint site, let's say mysite1, and I am trying to provide permissions in the following way: 
I obtained the site ID using the following URL: 

https://mydomain.sharepoint.com/sites/mysite1/_api/site/id. Let's say the site ID i got is 
11111-111-1111-11221

i have logged into https://developer.microsoft.com/en-us/graph/graph-explorer/

Post-->v1.0-->https://grapsh.microsoft.com/v1.0/sites/{11111-111-1111-11221}/permissions

Request headers: Key:application/json

Request Body:
{
    "roles": [
        "write"
    ],
    "grantedToIdentities": [
        {
            "application": {
                "id": "xxxx-xxxx-xxxxx-xxxxx", # This is my app regisration id
                "displayName": "TESTAPP"
            }
        }
    ]
}


When i click modify permissions and search for sites permissions, i am unable to provide consent, its grayed out. I am a global admin and i have full access on the SharePoint site. Please guide me.


Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
214 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,265 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,158 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,349 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,881 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karelpelck 0 Reputation points
    2024-07-06T20:41:24.0733333+00:00

    It might be less complex todo if you use PNP Powershell to configure this.

    Check out the "Granting permissions via PnP PowerShell" section of the following Learn page: https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins-modernize/understanding-rsc-for-msgraph-and-sharepoint-online#granting-permissions-via-pnp-powershell

    0 comments No comments