Skip to content

SharePoint Embedded assign permissions to container to an Azure AD group #9805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 9 tasks
mick-anderson24 opened this issue Jul 16, 2024 · 2 comments
Open
1 of 9 tasks
Assignees
Labels
Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. Needs: Triage 🔍 Awaiting categorization and initial review. sharepoint-developer-support sharepoint-developer-support type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@mick-anderson24
Copy link

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

other (enter in the "Additional environment details" area below)

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • Microsoft.graph SDK

Describe the bug / error

Using the graphServiceClient I am attempting to add permissions to a SharePoint embedded container to an Azure AD group. The examples and the documentation on the Graph API don't have examples and nothing says it isn't possible to assign a group to the sharepoint embedded container. Below is the executing code:

`var requestBody = new Permission
{
Roles = new List
{
"writer"
},
GrantedToV2 = new SharePointIdentitySet
{
Group = new Identity
{
Id = "17d4e352-2cff-41e8-902a-96ad2f33f3d0"
},
}
};

try
{

var permission = await _graphServiceClient.Storage.FileStorage.Containers[$"{id}"].Permissions.PostAsync(requestBody);
var p = permission;

}
catch(Exception ex)
{
var exception = ex;
}`

The exception I am seeing is: 'userPrincipalName' is required.
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.d__28.MoveNext()
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.d__201.MoveNext() at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.<SendAsync>d__201.MoveNext()
at Microsoft.Graph.Storage.FileStorage.Containers.Item.Permissions.PermissionsRequestBuilder.d__7.MoveNext()

Steps to reproduce

  1. Ensure you have the graphServiceClient configured and granted permissions with scopes "FileStorageContainer.Selected"
  2. Execute the following code: `var requestBody = new Permission
    {
    Roles = new List
    {
    "writer"
    },
    GrantedToV2 = new SharePointIdentitySet
    {
    Group = new Identity
    {
    Id = "17d4e352-2cff-41e8-902a-96ad2f33f3d0"
    },
    }
    };

try
{

var permission = await _graphServiceClient.Storage.FileStorage.Containers[$"{id}"].Permissions.PostAsync(requestBody);
var p = permission;

}
catch(Exception ex)
{
var exception = ex;
}`
3. See exception

Expected behavior

I would expect to be able to assign permissions to an Azure AD group to a Sharepoint embedded container. This is to allow all the members of the group permissions to the files in that container.

@mick-anderson24 mick-anderson24 added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Jul 16, 2024
@VesaJuvonen VesaJuvonen added the Needs: Triage 🔍 Awaiting categorization and initial review. label Jul 29, 2024
@Ashlesha-MSFT
Copy link

Ashlesha-MSFT commented Jun 12, 2025

Hello @mick-anderson24,
We will investigate and if we require further information we will reach out to you. Please use(https://aka.ms/DevCommunityEscalationForm) to escalate if you don't get replies in two working days.

Best regards, Teams

@Ashlesha-MSFT
Copy link

@mick-anderson24,
Have you verified below sample Samples/spe-ocr-sample
Also refer to this related GitHub issue: #9425

@Ashlesha-MSFT Ashlesha-MSFT self-assigned this Jun 12, 2025
@Ashlesha-MSFT Ashlesha-MSFT added sharepoint-developer-support sharepoint-developer-support Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. labels Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. Needs: Triage 🔍 Awaiting categorization and initial review. sharepoint-developer-support sharepoint-developer-support type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

3 participants