Using the Microsoft Graph to manage files in OneDrive/SharePoint like Azure Blob Storage
When compared to Azure Blob Storage, SharePoint/OneDrive for Business is much more cost effective, but it is important to note I am NOT doing a 1:1 on the features offered. You might want a fixed cost for the storing/accessing data or the sharing abilities of SharePoint or the sync features of OneDrive, for whichever reason Microsoft 365 Business makes sense.
You can even try it out for free, by joining the Microsoft 365 Developer Program.
You get a Microsoft 365 E5 developer subscription, with
25 user licenses for development purposes
Access core Microsoft 365 workloads and capabilities (Windows not included), including:
All Office 365 apps including SharePoint, OneDrive, Outlook/Exchange, Teams, Planner, Word, Excel, PowerPoint, and more
Office 365 Advanced Threat Protection
Advanced analytics with Power BI
Enterprise Mobility + Security (EMS) for compliance and information protection
Azure Active Directory for building advanced identity and access management solutions
Before you can play around with the Microsoft Graph, you need to register an App under your tenant. To set this up, go to https://portal.azure.com/
Browse to Azure Active Directory, click on the App registrations blade then click on New registration.
For Redirect Uri use https://localhost:8080/
After creating your app, click on the API permissions blade then click on Add a permission, select Microsoft Graph then choose Application permissions. In this example, tick Group.ReadWrite.All.
Next click Grant admin consent.
Now click on the Certificates & secrets blade then click on New client secret and add a secret.
That is about it! If you want an example of implementing the API to upload and download files, I have a basic C# project on GitHub.
If you're unsure what permissions are required by each endpoint, I suggest using the Microsoft Graph Explorer to find out.