How can I apply Sensitivity Labels to a Group in a Commercial Tenant using the Graph API without Delegated Permissions? (PATCH groups/{groupId})

Sean Arthur 1 Reputation point
2022-12-12T13:11:36.553+00:00

In a GCCH Tenant, this endpoint works using Application Permissions (i.e. NOT delegated permissions) - I know this limitation is documented here:

https://learn.microsoft.com/en-us/graph/api/group-update?view=graph-rest-beta&tabs=http#example-2-apply-sensitivity-label-to-a-microsoft-365-group

But since it works in GCCH using Application Permissions, it should work the same in Commercial. I have code that connects to both GCCH tenants and Commercial tenants, and the same calls fail in Commercial which succeed in GCCH.

Example:

PATCH groups/4*****d-e8a8-4d1a-****-93e*****e60b

with JSON body:

   "{\"assignedLabels\":[{\"labelId\":\"72***b19-****-42c3-****-cde6*****42d\"}]}"  

Gives back a response like this:

   "{\r\n  \"@odata.context\":\"https://substrate.office.com:444/CompliancePolicy/$metadata#Microsoft.Exchange.Compliance.Policy.Environment.MicrosoftGraphException\",\"error\":{\r\n    \"code\":\"Unauthorized\",\"message\":\"App-only token is not supported.\",\"innerError\":{\r\n      \"request-id\":\"cf042112-cbbf-448c-82f2-a8dd8bc14849\",\"date\":null\r\n    }\r\n  }\r\n}"  

This was asked over a year ago here without a response:

https://learn.microsoft.com/en-us/answers/questions/596299/apply-sensitivity-label-with-graph-api-beta.html

Azure Information Protection
Azure Information Protection
An Azure service that is used to control and help secure email, documents, and sensitive data that are shared outside the company.
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

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.