What to do to see a group created via GraphApi and Azure AD in Microsoft Teams?

Cierlik Marcin, DIGITAL, SEARGIN 0 Reputation points
2023-05-24T09:57:06.8866667+00:00

Hello. I've created a group via Graph Api. Visibility = public, GroupTypes = Unified. Then I added myself as a member (also via Graph Api). Should I do something more to see my new group in Microsoft Teams "Teams/Groups" section?

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
14,697 questions
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
6,630 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
1,320 questions
Microsoft Graph Groups API
Microsoft Graph Groups API
A Microsoft API that creates and manages different types of groups and group functionality.
204 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Vasil Michev 71,116 Reputation points MVP
    2023-05-24T16:23:51.5333333+00:00

    Can you clarify where exactly you want the group to appear? If you mean under the M365 Admin Center, no, you do not have to do anything else, just give it few minutes to replicate.

    If you want the Group to appear in the Teams client, it needs to be Teams-enabled first.


  2. CarlZhao-MSFT 23,356 Reputation points
    2023-05-25T06:44:13.0133333+00:00

    Hi @Cierlik Marcin, DIGITAL, SEARGIN

    If you are trying to create a new team under the group, then this error may be caused by delay, refer to the documentation:

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


  3. CarlZhao-MSFT 23,356 Reputation points
    2023-05-29T08:26:46.74+00:00

    Hi @Cierlik Marcin, DIGITAL, SEARGIN

    I can reproduce your question, please remove the Template object in the code.

    var graphTeam = new Team()
            {
                DisplayName = group.DisplayName,
                Description = group.Description,
                MemberSettings = new TeamMemberSettings
                {
                    AllowCreatePrivateChannels = true,
                    AllowCreateUpdateChannels = true,
                },
                MessagingSettings = new TeamMessagingSettings
                {
                    AllowUserEditMessages = true,
                    AllowUserDeleteMessages = true,
                },
                FunSettings = new TeamFunSettings
                {
                    AllowGiphy = true,
                    GiphyContentRating = GiphyRatingType.Strict,
                }, 
                GuestSettings = new TeamGuestSettings()
                {
                    AllowDeleteChannels = false, 
                    AllowCreateUpdateChannels = false
                }
             
    
            };
    
            await _graphClient.Groups["289a7d04-e247-4c24-ab25-edf8818752e1"].Team.Request().PutAsync(graphTeam);
    

    Or change your snippet to:

    // Code snippets are only available for the latest version. Current version is 5.x
    
    var graphClient = new GraphServiceClient(requestAdapter);
    
    var requestBody = new Team
    {
    	AdditionalData = new Dictionary<string, object>
    	{
    		{
    			"template@odata.bind" , "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"
    		},
    		{
    			"group@odata.bind" , "https://graph.microsoft.com/v1.0/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')"
    		},
    	},
    };
    var result = await graphClient.Teams.PostAsync(requestBody);
    

    Please refer to the example here.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.