I created teams in Microsoft Teams (from groups as documented here) via the C# graph-api sdk without any problems - everything was working just fine.
But suddenly this is not working anymore. I will always get the following exception at the line return await graphServiceClient.Teams.Request().AddAsync(team);:
Message: Failed to execute Templates backend request CreateTeamFromGroupWithTemplateRequest. Request Url: https://teams.microsoft.com/fabric/emea/templates/api/groups/theGroupId/team, Request Method: PUT,
And further:
Team Visibility can not be specified as it is inherited from the group.
I know that the visibility property must not be set if creating the team from a group as it states in the Microsoft documentation:
The team that's created will always inherit from the group's display name, visibility, specialization, and members. Therefore, when making this call with the [email protected] property, the inclusion of team displayName, visibility, specialization, or [email protected] properties will return an error.
But the currently used code below shows that I am not setting any forbidden properties - and this code worked for the last few days, too:
    private async Task<Team> CreateTeamFromGroup(string groupId)
    {
        var graphServiceClient = [...]
        var groupResourceLink = $"https://graph.microsoft.com/v1.0/groups('{groupId}')";
        var team = new Team
        {
            AdditionalData = new Dictionary<string, object>()
            {
                { "[email protected]", "https://graph.microsoft.com/beta/teamsTemplates('standard')" },
                { "[email protected]", groupResourceLink }
            },
            Channels = new TeamChannelsCollectionPage
            {
                new Channel
                {
                    DisplayName = "WhatEver"
                }
            }
        };
        return await graphServiceClient.Teams.Request().AddAsync(team);
    }
Is anyone else experiencing this problem? Was there an API change? Was the teams backend changed? Anyone any ideas?
P.S.: I am using the latest NuGet-Package for Microsoft Graph - downgrading didn't help.
Update (with a not very satisfying work-around)
- The error can be reproduced via the graph api explorer, too.
- The POST command above issues a PUT command, that is described here. With this request, the team can be created.
- The documentation and the graph api snippet for C# is out-dated, though. You have to add odatatype = null to the properties when using the sdk
- Unfortunately it is not possible to add channels in the same step. If you specify the property 'channels' it will just be ignored.
 
Update (Detailed error message)
System.AggregateException: 'One or more errors occurred. (Code: BadRequest Message: Failed to execute Templates backend request CreateTeamFromGroupWithTemplateRequest. Request Url: https://teams.microsoft.com/fabric/emea/templates/api/groups/theGroupId/team, Request Method: PUT, Response Status Code: BadRequest, ErrorMessage : {"errors":[{"message":"Team Visibility can not be specified as it is inherited from the group."}],"operationId":"639448e414ece64caee8f52839585bf7"} Inner error: AdditionalData: date: 2020-11-24T10:21:22 request-id: 37a28cac-3ac5-4bd2-a061-daf44c442fac client-request-id: 37a28cac-3ac5-4bd2-a061-daf44c442fac ClientRequestId: 37a28cac-3ac5-4bd2-a061-daf44c442fac )'