Feature: OneDrive Provider (ManagedCode.Storage.OneDrive)

Purpose

Expose OneDrive / Microsoft Graph as IStorage so .NET apps can store files in a drive/folder via Graph using the same provider-agnostic upload/download/list/delete API as other backends:

Main Flows

flowchart LR
  App --> OD[OneDriveStorage : IOneDriveStorage]
  OD --> Client[IOneDriveClient]
  Client --> Graph[Microsoft Graph]

Components

DI Wiring

dotnet add package ManagedCode.Storage.OneDrive
dotnet add package Azure.Identity
using Azure.Identity;
using ManagedCode.Storage.OneDrive.Extensions;
using Microsoft.Graph;

var credential = new ClientSecretCredential(
    tenantId: configuration["OneDrive:TenantId"]!,
    clientId: configuration["OneDrive:ClientId"]!,
    clientSecret: configuration["OneDrive:ClientSecret"]!);

var graphClient = new GraphServiceClient(credential, new[] { "https://graph.microsoft.com/.default" });

builder.Services.AddOneDriveStorageAsDefault(options =>
{
    options.GraphClient = graphClient;
    options.DriveId = "me";
    options.RootPath = "app-data";
});

Current Behavior

Tests

Configuration Notes

See docs/Development/credentials.md and README.md for step-by-step instructions on Entra ID app registration and Graph auth.