Forum Discussion

RogueAgent's avatar
RogueAgent
Copper Contributor
Jun 28, 2021

Issues with MS Graph Sites.Selected Permission in GCC High Tenant

Hello,

 

I see the Sites.Selected (roadmap feature ID 76685) 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 permissions endpoint 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: Controlling app access on a specific SharePoint site collections is now available in Microsoft Graph - Microsoft 365 Developer Blog

 

Thanks in advance!

 

RogueAgent

Resources