Home > Perform OneDrive Migrations > Required Permissions for OneDrive Migration > Permissions for Destination OneDrive > Custom App Profile Permissions
Export to PDFWith the Tenant Owner and Service Administrator role, you can create a custom app profile in AvePoint Online Services > Management > App management to connect to the Microsoft 365 tenant using a custom Azure app.
Refer to the following procedures to create a custom app profile:
Prepare a certificate in Microsoft Entra ID. Refer to for more information.
You can ignore this step if you have a certificate.
Create a custom Azure app in Microsoft Entra ID. Refer to for more information.
.
in AvePoint Online Services.
*Note: After you re-authorize the app profile, you need to wait about one hour before using the app profile for your migration to refresh the token if there are permissions updated.
Refer to the following tables to add API permissions required by OneDrive Migration to the custom Azure app.
| API | Permission | Type | Purpose |
|---|---|---|---|
| Microsoft Graph | Files.Read.All(Read files in all site collections) | Application | Retrieve the users’ OneDrive site URLs. |
| Microsoft Graph | User.Read.All(Read all users’ full profiles) | Application | Retrieve Microsoft 365 users for user mapping and retrieve users’ OneDrive site URLs. |
| Microsoft Graph | Sites.Read.All(Read items in all site collections) | Application | Only required if you want to run tenant discovery. |
| Microsoft Graph | ReportSettings.Read.All(Read all admin report settings) | Application | Only required if you want to run tenant discovery. |
| Microsoft Graph | Group.Read.All(Read all groups) | Application | Retrieve details of Microsoft 365 Groups. |
| Microsoft Graph | RoleManagement.Read.Directory(Read all directory RBAC settings) | Application | Retrieve Microsoft global groups and check required roles of the service account. |
| Microsoft Graph | Reports.Read.All(Read all usage reports) | Application | Only required if you want to run tenant discovery. |
| Microsoft Information Protection Sync Service | UnifiedPolicy.Tenant.Read (Read all unified policies of the tenant.) | Application | Only required if you want to manage sensitivity labels of files. |
| Azure Rights Management Services*Note: For 21Vianet tenants, the API name is Microsoft Rights Management Services. | Content.DelegatedWriter (Create protected content on behalf of a user) | Application | Only required if you want to manage sensitivity labels of files. |
| Azure Rights Management Services*Note: For 21Vianet tenants, the API name is Microsoft Rights Management Services. | Content.Writer (Create protected content) | Application | Only required if you want to manage sensitivity labels of files. |
| SharePoint/Office 365 SharePoint Online | Sites.FullControl.All (Have full control of all site collections) | Application | Retrieve settings and permissions of OneDrive sites. |
| SharePoint/Office 365 SharePoint Online | User.Read.All(Read user profiles) | Application | Retrieve SharePoint user profile service. |
For easy use, you can directly use the following commands to add required API permissions through Manifest for Microsoft 365 Commercial tenants.
"requiredResourceAccess": [
{
"resourceAppId": "00000003-0000-0ff1-ce00-000000000000",
"resourceAccess": [
{
"id": "678536fe-1083-478a-9c59-b99265e6b0d3",
"type": "Role"
},
{
"id": "df021288-bdef-4463-88db-98f22de89214",
"type": "Role"
}
]
},
{
"resourceAppId": "00000012-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "006e763d-a822-41fc-8df5-8d3d7fe20022",
"type": "Role"
},
{
"id": "d13f921c-7f21-4c08-bade-db9d048bd0da",
"type": "Role"
}
]
},
{
"resourceAppId": "00000003-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "01d4889c-1287-42c6-ac1f-5d1e02578ef6",
"type": "Role"
},
{
"id": "5b567255-7703-4780-807c-7be8301ae99b",
"type": "Role"
},
{
"id": "230c1aed-a721-4c5d-9cb4-a90514e508ef",
"type": "Role"
},
{
"id": "ee353f83-55ef-4b78-82da-555bfa2b4b95",
"type": "Role"
},
{
"id": "483bed4a-2ad3-4361-a73b-c83ccdbdc53c",
"type": "Role"
},
{
"id": "332a536c-c7ef-4017-ab91-336970924f0d",
"type": "Role"
},
{
"id": "df021288-bdef-4463-88db-98f22de89214",
"type": "Role"
}
]
},
{
"resourceAppId": "870c4f2e-85b6-4d43-bdda-6ed9a579b725",
"resourceAccess": [
{
"id": "8b2071cd-015a-4025-8052-1c0dba2d3f64",
"type": "Role"
}
]
}
],
*Note: The permissions listed above are required to migrate all OneDrive sites in your tenant. If you only need to migrate specific OneDrive sites, change to another custom app with different set of permissions. Refer to the following instructions:
| API | Permission | Type | Purpose |
|---|---|---|---|
| Microsoft Graph | Files.Read.All(Read files in all site collections) | Application | Retrieve the users’ OneDrive site URLs. |
| Microsoft Graph | User.Read.All(Read all users’ full profiles) | Application | Retrieve Microsoft 365 users for user mapping and retrieve users’ OneDrive site URLs. |
| Microsoft Graph | Sites.Selected(Access selected site collections) | Application | Retrieve and migrate data of specified OneDrive sites. |
| Microsoft Graph | Group.Read.All(Read all groups) | Application | Retrieve details of Microsoft 365 Groups. |
| Microsoft Graph | RoleManagement.Read.Directory(Read all directory RBAC settings) | Application | Retrieve Microsoft global groups and check required roles of the service account. |
| Microsoft Graph | ReportSettings.Read.All(Read all admin report settings) | Application | Only required if you want to run tenant discovery. |
| Microsoft Graph | Reports.Read.All(Read all usage reports) | Application | Only required if you want to run tenant discovery. |
| Microsoft Information Protection Sync Service | UnifiedPolicy.Tenant.Read (Read all unified policies of the tenant.) | Application | Only required if you want to manage sensitivity labels of files. |
| Azure Rights Management Services*Note: For 21Vianet tenants, the API name is Microsoft Rights Management Services. | Content.DelegatedWriter (Create protected content on behalf of a user) | Application | Only required if you want to manage sensitivity labels of files. |
| Azure Rights Management Services*Note: For 21Vianet tenants, the API name is Microsoft Rights Management Services. | Content.Writer (Create protected content) | Application | Only required if you want to manage sensitivity labels of files. |
| SharePoint/Office 365 SharePoint Online | Sites.Selected(Access selected site collections) | Application | Retrieve and migrate data of specified OneDrive sites. |
| SharePoint/Office 365 SharePoint Online | User.Read.All(Read user profiles) | Application | Retrieve SharePoint user profile service. |
"requiredResourceAccess": [
{
"resourceAppId": "00000003-0000-0ff1-ce00-000000000000",
"resourceAccess": [
{
"id": "df021288-bdef-4463-88db-98f22de89214",
"type": "Role"
},
{
"id": "20d37865-089c-4dee-8c41-6967602d4ac8",
"type": "Role"
}
]
},
{
"resourceAppId": "00000003-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "01d4889c-1287-42c6-ac1f-5d1e02578ef6",
"type": "Role"
},
{
"id": "5b567255-7703-4780-807c-7be8301ae99b",
"type": "Role"
},
{
"id": "230c1aed-a721-4c5d-9cb4-a90514e508ef",
"type": "Role"
},
{
"id": "ee353f83-55ef-4b78-82da-555bfa2b4b95",
"type": "Role"
},
{
"id": "483bed4a-2ad3-4361-a73b-c83ccdbdc53c",
"type": "Role"
},
{
"id": "883ea226-0bf2-4a8f-9f9d-92c9162a727d",
"type": "Role"
},
{
"id": "df021288-bdef-4463-88db-98f22de89214",
"type": "Role"
}
]
},
{
"resourceAppId": "00000012-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "006e763d-a822-41fc-8df5-8d3d7fe20022",
"type": "Role"
},
{
"id": "d13f921c-7f21-4c08-bade-db9d048bd0da",
"type": "Role"
}
]
},
{
"resourceAppId": "870c4f2e-85b6-4d43-bdda-6ed9a579b725",
"resourceAccess": [
{
"id": "8b2071cd-015a-4025-8052-1c0dba2d3f64",
"type": "Role"
}
]
}
],
in your environment.
Access the and download the RegisterAzureADAppForGrantFullControl.ps1, GrantFullControlForOneDriveUser.ps1 and OneDriveUsers.csv files to a custom folder on a machine with a network connection.
In the custom folder, open the RegisterAzureADAppForGrantFullControl.ps1 file with Notepad, and configure the following parameters based on your needs. Then, save the file.
Tenant – The name of your tenant. For example, mytenant.onmicrosoft.com.
AzureEnvironment – The Azure environment for authentication.
ApplicationName – (Optional) The name of the Azure AD app to be created. By default, the name will be PnP PowerShell For Grant Full Control.
Enter a password for the app certificate, and press Enter on the keyboard.
Sign in with a user in your tenant to create the app.
*Note: While registering the Azure AD app, the Permissions requested page will appear. Sign in using the Global Administrator account and click Accept to continue the registration.
The table below lists the required permissions by the app.
| API | Permission | Type |
|---|---|---|
| Microsoft Graph | Sites.FullControl.All(Have full control of all site collections) | Application |
| Microsoft Graph | User.Read.All(Read all users’ full profiles) | Application |
| SharePoint/Office 365 SharePoint Online | Sites.FullControl(Have full control of all site collections) | Application |
| SharePoint/Office 365 SharePoint Online | User.Read.All(Read user profiles) | Application |
7. In the custom folder, open the OneDriveUsers.csv file, and enter the usernames of the OneDrive sites to be migrated as below.
8. In the custom folder, open the GrantFullControlForOneDriveUser.ps1 file with Notepad.
Configure the following parameters with required information.
$appId = ' ' – Enter the client ID of your custom app.
$appName = ' ' – Enter the display name of your custom app.
$AzureEnvironment = ' ' – Enter the Azure environment for authentication.
$certPath = 'PnP PowerShell For Grant Full Control AppCertificate Path(.pfx)' – Enter the full path of the generated app certificate.
$connection = Connect-PnPOnline
Url – Enter the SharePoint admin center URL of your tenant.
*Note: Your custom app may not have permissions to the SharePoint admin center URL. To avoid verifying the tenant domain while adding the connection in Fly, you can add the IsCheckAdminUrl=false string to the Customized features section in the migration policy.
ClientId – Enter the client ID of the PnP PowerShell For Grant Full Control app.
Tenant – Enter the ID of your tenant.
Open Windows PowerShell and enter the following commands in the Windows PowerShell window:
. "file path"
Replace file path with the full path of the GrantFullControlForOneDriveUser.ps1 file in the extracted folder, and press Enter on the keyboard.

Enter the certificate key of your custom app, and press Enter on the keyboard.
Enter the certificate password of the PnP PowerShell For Grant Full Control app, and press Enter on the keyboard.