What is the problem?
A common enterprise automation scenario involves copying files from a OneDrive folder shared by a colleague into another storage service such as SharePoint or Azure Blob Storage using Azure Logic Apps.
However, when you configure the OneDrive for Business – “List files in folder” action in a Logic App, you quickly run into a limitation:
- The folder picker only shows:
- Root directory
- Subfolders of the authenticated user’s OneDrive
- Shared folders do not appear at all, even though you can access them in the OneDrive UI
This makes it seem like Logic Apps cannot work with shared OneDrive folders—but that’s not entirely true.
Logic app's "List files in folder" action from OneDrive for business connector showing list of folders while when clicked on the file picker iconWhy this happens
The OneDrive for Business connector is user‑context scoped. It only enumerates folders that belong to the signed-in user’s drive and does not automatically surface folders that are shared with the user.
Even though shared folders are visible under “Shared with me” in the OneDrive UI, they:
- Live in a different drive
- Have a different driveId
- Require explicit identification before Logic Apps can access them
How to access a shared OneDrive folder
There are two supported ways to access a shared OneDrive directory from Logic Apps.
Option 1: Use Microsoft Graph APIs (Delegated permissions)
You can invoke Microsoft Graph APIs directly using:
- HTTP with Microsoft Entra ID (preauthorized)
- Delegated permissions on behalf of the signed‑in user
This requires:
- Admin consent or delegated consent workflows
- Additional Entra ID configuration
📘 Reference: HTTP with Microsoft Entra ID (preauthorized) - Connectors | Microsoft Learn
While powerful, this approach adds setup complexity.
Option 2: Use Graph Explorer to configure the OneDrive connector
Instead of calling Graph from Logic Apps directly, you can:
- Use Graph Explorer to discover the shared folder metadata
- Manually configure the OneDrive action using that metadata
Step-by-step: Using Graph Explorer to access a shared folder
Scenario
A colleague has shared a OneDrive folder named “Test” with me, and I need to process files inside it using a Logic App.
Step 1: List shared folders using Microsoft Graph
In Graph Explorer, run the following request:
GET https://graph.microsoft.com/v1.0/{OneDrive shared folder owner username}/drive/root/children
📘Reference: List the contents of a folder - Microsoft Graph v1.0 | Microsoft Learn
✅This returns all root-level folders visible to the signed-in user, including folders shared with you.
From the response, locate the shared folder. You only need two values:
- parentReference.driveId
- id (folder ID)
Graph explorer snippet showing the request sent to the API to list the files & folders shared by a specific user on the root drive
Step 2: Configure Logic App “List files in folder” action
In your Logic App:
- Add OneDrive for Business → List files in folder
- Do not use the folder picker
- Manually enter the folder value using this format: {driveId}.{folderId}
Once saved, the action successfully lists files from the shared OneDrive folder.
Step 3: Build the rest of your workflow
After the folder is resolved correctly:
- You can loop through files
- Copy them to SharePoint
- Upload them to Azure Blob Storage
- Apply filters, conditions, or transformations
All standard OneDrive actions now work as expected.
Troubleshooting: When Graph Explorer doesn’t help
If you’re unable to find the driveId or folderId via Graph Explorer, there’s a reliable fallback.
Use browser network tracing
- Open the shared folder in OneDrive (web)
- Open Browser Developer Tools → Network
- Look for requests like:Browser network trace snippet on how to fetch the required driveID & folderId
- In the response payload, extract:
- CurrentFolderUniqueId → folder ID
- drives/{driveId} from the CurrentFolderSpItemUrl
This method is very effective when Graph results are incomplete or filtered.