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?

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
14,745 questions
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
6,653 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sharon Zhao-MSFT 24,851 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