question

LotfiBOUCHERIT-4930 avatar image
0 Votes"
LotfiBOUCHERIT-4930 asked CarlZhao-MSFT commented

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

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-teamworkmicrosoft-graph-explorer
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@LotfiBOUCHERIT-4930 Would you please provide us with an update on the status of your issue?

0 Votes 0 ·
CarlZhao-MSFT avatar image
1 Vote"
CarlZhao-MSFT answered LotfiBOUCHERIT-4930 converted comment to answer

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.


298.png (96.4 KiB)
image.png (67.5 KiB)
· 8
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @CarlZhao-MSFT ,
Thank you so much for your help..
I'm just confused because i do not find exactly where to set it...
I searched in Azure AD, Office 365 admin portals but didn't find it..
Could you please, help me find it??
(Newbie in O365... apologies)

0 Votes 0 ·
CarlZhao-MSFT avatar image CarlZhao-MSFT LotfiBOUCHERIT-4930 ·

Hi,Have you not registered an application in AzureAD?

0 Votes 0 ·
CarlZhao-MSFT avatar image CarlZhao-MSFT LotfiBOUCHERIT-4930 ·

It doesn't matter @LotfiBOUCHERIT-4930 , let's solve this problem together.

0 Votes 0 ·
CarlZhao-MSFT avatar image CarlZhao-MSFT LotfiBOUCHERIT-4930 ·

Hi,,,Are there any updates?

0 Votes 0 ·

Hi again @CarlZhao-MSFT
I believe i found something in AzureAD admin portal.
When open settings of my useraccount, then i click on applications, then i select Microsoft Graph
I find a link in the bottom to manage permissions

First, i clicked the button View Granted Permissions
130626-image.png
Even when i click to big blue button, nothing happens and i do not find the Teamwork.Migrate.All permission

Please, could you help me with this? i believe that here where i'm blocked now...

Thank you in advance,

0 Votes 0 ·
image.png (25.3 KiB)

Here is the problem, please:
130663-image.png


0 Votes 0 ·
image.png (17.8 KiB)
CarlZhao-MSFT avatar image CarlZhao-MSFT LotfiBOUCHERIT-4930 ·

You should find your app in App registrations and grant permission to the app.

130520-image.png


0 Votes 0 ·
image.png (70.9 KiB)
CarlZhao-MSFT avatar image CarlZhao-MSFT LotfiBOUCHERIT-4930 ·

Hi, don't try to grant permissions in the enterprise app, can you find the app in App registrations?

130658-image.png


0 Votes 0 ·
image.png (65.3 KiB)
LotfiBOUCHERIT-4930 avatar image
0 Votes"
LotfiBOUCHERIT-4930 answered CarlZhao-MSFT edited

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



image.png (18.0 KiB)
· 8
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Do you have to use a specific application? If it is not, I suggest you to create a new application.

130579-image.png


0 Votes 0 ·
image.png (41.4 KiB)

@LotfiBOUCHERIT-4930 Hi, Would you please provide us with an update on the status of your issue?

0 Votes 0 ·

Hello @CarlZhao-MSFT
Thank you so much for asking..
Actually, i did create a new app registration called it myapp_reg as you requested, then added the API permission Teamwork.Migration.All
130997-image.png
Since yesterday, i try to do the second part you talked about, related to Postman, but i really feel lost here..
If you just can tell me what to do next?
Because, for now, when i go to Graph Explorer, i do not find the new permission or the new app registered.
Thank you in advance,


0 Votes 0 ·
image.png (32.9 KiB)
CarlZhao-MSFT avatar image CarlZhao-MSFT LotfiBOUCHERIT-4930 ·

hi, I am glad to hear that you have created a new application. Next, you can get the access token in postman and call the api in postman as stated in the answer I posted. Please note, do not do anything in Graph Explorer, because Graph Explorer is not suitable for our scenario.

0 Votes 0 ·
CarlZhao-MSFT avatar image CarlZhao-MSFT LotfiBOUCHERIT-4930 ·

1.
131045-image.png


2.
130999-image.png

131125-image.png


0 Votes 0 ·
image.png (74.4 KiB)
image.png (61.0 KiB)
image.png (39.8 KiB)

@CarlZhao-MSFT
Thank you so much for this explanation!!
This did create the new Team with the JSON code in the first post, but i'm not sure: when i click on it in the Teams Admin Portal, i get this:
131057-image.png


Could you please, tell me what i have to do here?

0 Votes 0 ·
image.png (17.2 KiB)
CarlZhao-MSFT avatar image CarlZhao-MSFT LotfiBOUCHERIT-4930 ·

If your team does not specify an owner, this error will occur. You can specify an owner for the team in Azure AD. Go to Azure portal>Groups>your teams>Owners.


1.
131551-image.png

2.
131500-image.png

3.

131572-image.png


0 Votes 0 ·
image.png (52.6 KiB)
image.png (46.8 KiB)
image.png (21.0 KiB)
CarlZhao-MSFT avatar image CarlZhao-MSFT LotfiBOUCHERIT-4930 ·

Hi, If an Answer is helpful, please click "Accept Answer" and upvote it :)

0 Votes 0 ·