Can Microsoft Graph auto-grant Sites.Selected access on the site created when provisioning an M365 Group?

Paulo Granja 0 Reputation points
2026-09-04T09:32:12.63+00:00

We provision Microsoft 365 Groups programmatically via Microsoft Graph as part of a legal matter management system.

Our app registration is scoped with Sites.Selected only (not tenant-wide Sites.ReadWrite.All), following least-privilege guidance.

When we create a new M365 Group via POST /groups, Microsoft Graph/SharePoint automatically provisions a backing SharePoint site for that group. However, that new site is not automatically added to our app's Sites.Selected access list, so any subsequent Graph calls against that site (e.g. drive/list operations) fail with accessDenied, even though our app was the one that triggered the group/site creation.

Questions:

  1. Is there a supported way to have the site automatically included in the creating app's Sites.Selected grants at group/site creation time (e.g. an option on the group creation call, or an implicit grant because the app created the group)?
  2. If not, is granting site permissions via POST /sites/{site-id}/permissions immediately after group creation the recommended pattern, or is there a better-supported approach for this "app creates a group and immediately needs write access to its site" scenario?
  3. Is there a race condition to be aware of between M365 Group creation and the backing SharePoint site becoming available/addressable for a permissions grant?

Any guidance on the intended pattern for apps using Sites.Selected that also need to provision groups/sites would be appreciated.

Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Most helpful
  1. Billy Peralta 0 Reputation points
    2026-11-20T06:36:59.21+00:00

    Hi,

    I'm not aware of an option in POST /groups that automatically grants an application Sites.Selected access to the group's SharePoint site.

    I'd handle this as part of the provisioning process:

    1. Create the Microsoft 365 group.
    2. Retrieve its SharePoint site using GET /groups/{id}/sites/root.
    3. Grant the application access using POST /sites/{site-id}/permissions.

    The SharePoint site may not be ready immediately, so allow for retries with a timeout. Respect the Retry-After header if Microsoft Graph throttles the requests.

    Creating the site permission requires Sites.FullControl.All. An application with only Sites.Selected cannot grant itself access to a new site.

    You could use a separate, tightly controlled provisioning identity to perform the grants, while keeping your main application on Sites.Selected.

    Microsoft references:

    Was this answer helpful?

    0 comments No comments

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.