Graph API create groups and teams from SPFx webpart with elevated privileges

Daniel Chok 1 Reputation point

I have a SPFx webpart which is a form for users to submit requests which will run the group and teams provisioning code.

The code works fine when the user is logged in as a 'Global Admin', but when a normal user with minimum permission levels uses the form, the provisioning is not allowed and is faced with these errors:

Creating group is not allowed:

Creating teams is not allowed:

Is there a way to run the code regardless of the user context? or any ways to elevate the privilege of the webpart or block of code?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,251 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,850 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sharon Zhao-MSFT 25,061 Reputation points Microsoft Vendor

    Hi DanielChok-9925,

    When you create a new team under a group, one of the following permissions is required to this API.
    When you create a new group, one of the following permissions is required to call this API.
    If it has no help, we suggest you ask for help in MSDN forum.

    0 comments No comments