Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Personal One Drive Microsoft Graph binding in Azure Functions

How do you use the One Drive Microsoft Graph Binding with personal one drive ?

When running an Azure Function created in Azure Portal with One Drive Input Binding, an exception occurs and I receive the following error :

Code: BadRequest
Message: Tenant does not have a SPO license.

As I don't have Office 365 on this azure tenant, I understand that I could have this kind of error if I was requested a file from One Drive Business but I am using a Microsoft account (UserFromId).

like image 978
TechWatching Avatar asked Nov 05 '25 22:11

TechWatching


1 Answers

You need to configure Microsoft account authentication for the azure function from AAD https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-microsoft When you configure Input Binding click manage enter image description here

then choose mIcrosoft account

enter image description here

Goto this link https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade

choose manage personal account enter image description here

register a new application and then add the client secret to the application enter image description here

and give it update permission or read write to Onedrive enter image description here To get the user ID: enter your azure function URL as below to authenticate https://yourfunction.azurewebsites.net/.auth/login/aad

then access https://yourfunction.azurewebsites.net/.auth/me grab user_id

enter your outlook.com user ID as below: enter image description here

like image 177
Anass Kartit Avatar answered Nov 09 '25 09:11

Anass Kartit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!