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?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,463 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,506 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,455 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Vasil Michev 109.7K 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 43,256 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 43,256 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.