Creating a Sharepoint (Graph) Service Account provides elevated permissions that allow you to access additional information outside of a standard Office365 user/admin.
Creating the App Registration
Then click on "New Registration":
Then enter the following information and click Register:
Name: Migration Application
Supported Account Types: Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)
Adding the Necessary Permissions
Now, click on Manage > API Permissions > Add a Permission:
In the blade that appears, select Microsoft Graph:
And then select Application Permissions:
Then Add the following permissions (you may need to repeat this for each permission you are adding):
- Directory.ReadWrite.All
- Sites.ReadWrite.All
- User.ReadWrite.All
The permissions listed above are suitable for migrations into and out of Office365.
If you are simply doing migrations out of Office365, you may use the "Read" permission set instead of the "ReadWrite" permission set.
Once that is complete, click the "Grant Admin Content for {Org}" button:
Getting the Application "Username"
Click on Overview and note the Application (Client) ID and the Directory (Tenant) Id:
The Application Id is essentially a username.
The Directory Id is essentially your organization's Id.
Creating an Application Password (Secret)
Now click on Manage > Certificates & Secrets > New Client Secret
In the dialog that appears, enter the following values and click Add:
Description: Migration Application
Expires: 730 Days (24 Months)
The expiration of 730 days will accommodate nearly all scenarios.
For optimal security, this password should expire shortly after your migration will be complete.
Once the secret is created, save its value.
The Secret is essentially the password.
Account Creation Complete!
Once you have the Directory (Tenant) Id, Application Id, and Secret you have everything you need to log in as a service account.