Office365 Related Activity Fails With Access Denied

While downloading files, sometimes, the bot fails with "access denied". Note : Manually opening the site and downloading the files or uploading the files works without any issue.

Issue Description:
When using "UiPath.MicrosoftOffice365.Activities" to download or upload files from SharePoint, the UiPath Robot intermittently failed with an "access denied" error.

Resolution:

  1. Check and confirm that the Application ID and Tenant ID used in the activity's properties correspond to what you have in Azure
  2. Check Azure AD in the App Registration and go to the Overview tab. Change the value of the OAuthApplication property from UiPath to Custom in the Office365 scope. (UiPath->Custom)
  3. Reinforce the creation of the authentication token files. Instructions: How To Manage The Authentication Tokens Generated By Microsoft Office 365 Activities
  4. After doing this, run the workflow again.