Skip to content
Auto
Products

OneDrive file system

This file system provides an implementation for the file system based on OneDrive, using Microsoft Graph.

var credential = new Azure.Identity.ClientSecretCredential(tenantId, clientId, clientSecret);
using var fileSystem = TagBites.IO.OneDrive.OneDriveFileSystem.Create(credential);
// ... using like standard file system

An access token acquired elsewhere works as well:

using var fileSystem = TagBites.IO.OneDrive.OneDriveFileSystem.Create(accessToken);

Without a driveId the signed-in user’s own drive (/me/drive) is used, which requires delegated authentication. Passing a driveId targets a specific drive and works with application-only authentication too.

  • Asynchronous operations. Synchronous calls run on top of them.
  • Metadata: none.
  • A raw access token is not refreshed. Long-running processes need the TokenCredential overload.

Full implementation on github: TagBites.IO.OneDrive.