An API that connects multiple Microsoft services, enabling data access and automation across platforms
Hi Robert,
Thanks for posting questions on Microsoft Forum
Currently, Microsoft Graph API does not support read/write access to shared Excel files using App-only permissions. This is a known constraint, as App-only permissions are scoped to resources owned by the app (like SharePoint sites or OneDrive drives the app has been explicitly granted access to), and not to files shared by users.
However, there are a couple of workarounds and best practices that might help you achieve your goal:
Option 1: Use a Dedicated Service Account + Delegated Permissions
Create a dedicated Microsoft 365 user account (e.g., ******@yourdomain.com) and have users share the Excel files with this account.
Authenticate your backend using delegated permissions via this account using the OAuth 2.0 Resource Owner Password Credentials (ROPC) flow or interactive token caching.
This allows your backend to act on behalf of the service account and access shared files.
Option 2: Use App-Only Access with SharePoint Sites and Sites.Selected Permission
If the Excel files are stored in SharePoint document libraries (including OneDrive for Business), you can:
Move or copy the shared Excel files to a SharePoint site or OneDrive folder owned by your app or a service account.
Grant your app Sites.Selected permission and explicitly assign access to the specific site or drive using PowerShell or Microsoft Graph.
Use App-only access to read/write Excel files stored in that location.
This approach is more secure and scalable for background jobs.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment