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

Daniel Chok 1 Reputation point
2020-05-19T11:19:52.48+00:00

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:
8438-tenant-admin-has-not-enabled-unified-group-creatio.png

Creating teams is not allowed:
8330-teams-disabled-in-user-license-admin-non-prod-subm.png

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
    2020-05-20T02:39:35.773+00:00

    Hi DanielChok-9925,

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

    0 comments No comments