Graph Explorer - Teams - Create a new team in Migration Mode

Lotfi BOUCHERIT 91 Reputation points
2021-09-08T21:36:00.46+00:00

Hello,
I am trying to migrate from Slack to MS Teams, and the first step, which is creating a new team in "Migration Mode", does not seem to work for me.
As stated in the MS documents, i need to use, Graph Explorer, and use this JSON code:

POST https://graph.microsoft.com/beta/teams
{
"@microsoft.graph.teamCreationMode": "migration",
"template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('standard')",
"displayName": "My Sample Team",
"description": "My Sample Team’s Description",
"createdDateTime": "2020-03-14T11:22:17.067Z"
}

And the error is the following, and i cannot find the solution for it:

{
    "error": {
        "code": "BadRequest",
        "message": "Migration is only supported in app-only context.",
        "innerError": {
            "date": "2021-09-08T21:20:00",
            "request-id": "6a3960ea-f81d-4f23-be59-50f700384a38",
            "client-request-id": "2d8cbe9a-a831-a9f0-5d89-04dd3e8586a5"
        }
    }
}

If anyone can help here, i'd be so grateful,
Thank you in advance,

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,293 questions
{count} votes

2 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 36,001 Reputation points
    2021-09-09T01:51:47.313+00:00

    As the error message reported: Migration is only supported in app-only context. Because Graph Explorer is usually used in user context, it uses user tokens instead of application tokens, so you cannot use Graph Explorer Tool to call the api.

    According to the documentation, you must use the Teamwork.Migrate.All application permission when you create a team in a migration state, so you must grant this permission to your application in Azure AD and then grant the admin consent.

    130541-298.png

    Then you need to use client credential flow in postman to get the application token.

    130561-image.png

    Finally, you will be able to use the token to call the api in postman.


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    1 person found this answer helpful.

  2. Lotfi BOUCHERIT 91 Reputation points
    2021-09-09T08:28:54.657+00:00

    Hi @CarlZhao-MSFT
    In all applications, i do not find Graph application, in owned applications,
    130578-image.png
    Thank you in advance, for your help