1
votes

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 )'

2
I'm seeing this since 18.15 UTC on 20th November - zippy72
share the requestid, timestamp of the response that you got with the error... - Dev
Hi @Dev, I added a detailed error message at the end of the original post. Thank you. - timtos
We have the same error. There is also something on github about this issue. So it seems MS rolled out something last weekend that doesn't work. - Oliver
Things are getting better, but still are not working completely. Making the request with a user auth token and without specifing an owner, it will work. But if you add an owner to the request, the same error still occurs (details are here). - Oliver

2 Answers

0
votes

Just tested this morning and I can say, that the "old way" by using the beta API to create a team with a template works again. Don't know, how many other ways exist to do these things, but here is our current request, that works now (again).

POST https://graph.microsoft.com/beta/teams
{
    "displayName": "My Group Name",
    "description": "Some description",
    "[email protected]": "https://graph.microsoft.com/beta/teamsTemplates('educationClass')",
    "[email protected]": [
        "https://graph.microsoft.com/beta/users('<someValidUserId>')"
    ]
}

I think this will be just an intermediate state and when the bugs are fixed, they will publish the new version again and this kind of creation will fail again, but if in this case the v1.0 documented way will work this wouldn't be a big problem. But being informed BEFORE there roll-out starts would be great.

0
votes

This was a Microsoft issue/ bug and is currently being fixed as stated here.