| Solution | - Log in to the Office 365 site and navigate to the Azure Portal Home.
- Search for app registrations. Choose App registration:
 - Create a New Registration.
 - Add a Name and supported Account Type. Choose the tenant or tenants to register. Select Create. A summary of the application will be shown.
 - Copy the Application (client) ID and copy the Directory (tenant) ID. Then add a Client Credential.
 - Create a Client Secret and set the expiration date:
 - Return to App Registrations. Choose All Applications. Choose the recently created SharePointOnline App.
 - Go to Manage -> API Permissions (inside SharepointOnline App created).
Choose the Microsoft Graph and add the following permissions in Application Mode. - Application.Read.All
- AuditLog.Read.All Application
- Directory.Read.All Application
- Files.ReadWrite.All Application
- Group.Read.All Application.
- GroupMember.Read.All Application
- Organization.Read.All Application
- People.Read.All Application
- Reports.Read.All Application
- Sites.FullControl.All Application
- Sites.Manage.All Application
- Sites.ReadWrite.All Application
- User.Read.All Application
- Additionally, select Add permission and add Office 365 Management APIs as Application Mode.
- ActivityFeed.Read Application.
- Grant Admin Consent to All permissions.
Check the following image for all permissions:  - Now, go to FortiData -> Storages, and add a storage. Add the following credentials:
- TenantID = Tenant Directory ID
- Client ID = Application Tenant ID
- Client Secret = Value of Secret ID
Test the connection.
 - Now, create a Discovery Scan and choose the SharePoint Online Storage.
|