How to allow my app without user to access ONLY specific drive or folder

清水 明士 56 Reputation points
2021-12-23T00:02:37.997+00:00

Dear community,

I'm creating an app using Microsoft Graph to upload/download files from/to OneDrive/SharePoint.
This app is a type of demon, without users, which is triggered by other app or process in auto.

The app is given Files.ReadWrite.All permission which requires Admin Consent.
This Files.ReadWrite.All permission is too strong to use in my case.

How do we restrict the app to access only specific drives or folders of OneDrive/SharePoint?

Microsoft 365 and Office SharePoint For business Windows
Microsoft 365 and Office OneDrive For business Windows
Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2021-12-23T07:24:05.353+00:00

    You cannot restrict it to specific files only, but you can restrict which Site collections (drives) can be accessed as detailed here: https://devblogs.microsoft.com/microsoft365dev/controlling-app-access-on-specific-sharepoint-site-collections/
    Or consider using the delegate permissions model instead.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.