Error when attempting to add a Microsoft Team to an existing Office 365 Group using teams team add --groupId
o365 teams team add --groupId 946a6bbe-045a-4031-8b5b-04c7353b357d
Team is created

MacOS Catalina, zsh, 2.9.0
On closer inspection, the request is using the /beta/groups/{groupid}/team endpoint that has been deprecated in favour of using the /beta/team endpoint.
Source: https://docs.microsoft.com/en-us/graph/api/team-put-teams?view=graph-rest-beta&tabs=http#permissions
We do already provide another command that creates a Team from an existing Office 365 group, aad o365group teamify which uses the new method suggested in Graph docs.
Rather than fix the teams team add command duplicating functionality, I suggest removing the --groupId parameter as we have an alternative command, create an alias for the aad o365group teamify command under the teams group.
It also simplifies the command making it easier to implement #916
Thoughts @pnp/office-365-cli-maintainers ?
Rather than fix the teams team add command duplicating functionality, I suggest removing the --groupId parameter as we have an alternative command, create an alias for the aad o365group teamify command under the teams group.
aad o365group teamify and teams team add are not quite the same. teams team add allows you to create a Team from scratch while aad o365group teamify allows you to extend an existing group with a Team. So both commands are only the same when you teamify an existing group, but in case you want to create a new Team with a new group, you still need teams team add.
We could go about it two ways:
groupId option and in the help we include explanation pointing people to aad o365group teamify if they want to teamify an existing groupgroupId option and fix the command so that we don't bother people with our technical implementation and let them teamify no matter if they think in terms of groups or teams. The downside is, as you mentioned, that we'd duplicate the code base.My vote would go to option 1, this keeps the teams team add command specific to creating a Team from scratch.
Check. @VelinGeorgiev, @appieschot, what do you guys think?
Vote for option 1 as well :), we should track usage though, do we see a drop in the use of the command once option 1 is implemented. That might give insights into how it is being used.
One step ahead of ya: from the last 3 months of usage, only 11% calls used the groupId options. With that, let's stick to option 1.
Most helpful comment
One step ahead of ya: from the last 3 months of usage, only 11% calls used the
groupIdoptions. With that, let's stick to option 1.