Forum Discussion
Issues with MS Graph Sites.Selected Permission in GCC High Tenant
Hello,
I see the https://docs.microsoft.com/en-us/graph/permissions-reference#application-permissions-53 https://www.microsoft.com/en-us/microsoft-365/roadmap?filters=&searchterms=sites.selected MS Graph API permission in my GCC High tenant in the Azure portal when I create an app registration, but I'm not sure that it has been fully implemented yet as I receive an error when running this command:
Invoke-RestMethod -Headers @{Authorization = "Bearer $token"} -Uri $getSitePermissionsURL -Method POST -Body $permissions -ContentType "application/json"
Here is the $permissions variable:
$permissions = @{
'roles' = ('write')
'grantedToIdentities' = @{
'application' = @{
'id' = '...'
'displayName' = '...'
}
}
} | ConvertTo-Json
Here is the error:
{"error":{"code":"BadRequest","message":"Resource not found for the segment
| 'permissions'.","innerError":{"date":"2021-06-26T07:03:06","request-id":"...","client-request-id":"..."}}}
I believe that I have everything correct, when I change the method to GET and the URL to "https://graph.microsoft.us/v1.0/sites/$siteID/" I do receive the site's data back, but there is no https://docs.microsoft.com/en-us/graph/api/resources/permission?view=graph-rest-1.0 shown:
@odata.context : https://graph.microsoft.us/v1.0/$metadata#sites/$entity
createdDateTime : 5/11/2021 11:28:09 PM
description : ...
id : ...
lastModifiedDateTime : 6/26/2021 2:53:35 AM
name : ...
webUrl : ...
displayName : ...
parentReference :
Here is an additional reference for background: https://developer.microsoft.com/en-us/graph/blogs/controlling-app-access-on-specific-sharepoint-site-collections/
Thanks in advance!
RogueAgent
1 Reply
- RogueAgentCopper ContributorIt turns out that Microsoft hasn't made the sites.selected permission available in GCC High yet, even though it appears in the API permissions list. Reference this thread: https://githubhot.com/repo/pnp/powershell/issues/1579