emdelaney
emdelaney

Reputation: 23

How do I create files in an AppFolder in OneDrive for Business using the Microsoft Graph API?

I have a custom Azure AD App, "Microsoft Graph Test", with the Files.ReadWrite.AppFolder delegated permission. Based on the Graph API Reference for special folders, I believe that GET https://graph.microsoft.com/v1.0/me/drive/special/approot should be creating an AppFolder for my app if it doesn't already exist. However, when I execute the request (using the Graph Explorer from the Excel Graph Sample) I see a 401 Unauthorized response.

If I give the app the Files.ReadWrite scope, the same command results in a 200 OK result that creates a folder in OneDrive for Business at Apps/Microsoft.Azure.AgregatorService.

Based on this, I have two questions:

  1. What Microsoft Graph operations does the Files.ReadWrite.AppFolder scope enable?
  2. How can I create and access an AppFolder using the Files.ReadWrite.AppFolder scope?

Upvotes: 2

Views: 1383

Answers (1)

Ryan Gregg
Ryan Gregg

Reputation: 2035

The Files.ReadWrite.AppFolder scope is invalid and shouldn't be used. I've opened a bug to get the documentation fixed to remove this reference. Right now through Microsoft Graph you need to request Files.ReadWrite permissions to use app folders.

I'm investigating the issue where the app folder name was created as AgregatorService instead of your app's actual name.

Upvotes: 1

Related Questions