Azure Functions中的个人One Drive Microsoft Graph绑定 [英] Personal One Drive Microsoft Graph binding in Azure Functions
问题描述
您如何将One Drive Microsoft Graph Binding与个人一个驱动器一起使用?
How do you use the One Drive Microsoft Graph Binding with personal one drive ?
运行具有一个驱动器输入绑定的在Azure门户中创建的Azure函数时,发生异常,并且我收到以下错误:
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.
由于我在这个蔚蓝的租户上没有Office 365,因此我了解到,如果从One Drive Business请求文件但我使用的是Microsoft帐户(UserFromId),则可能会出现这种错误.
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).
推荐答案
您需要为AAD中的azure功能配置Microsoft帐户身份验证 https://docs.microsoft.com/zh-CN/azure/app-service/configure-authentication-provider-microsoft 配置输入绑定时,单击管理
You need to configure Microsoft account authentication for the azure function from AAD https://docs.microsoft.com/en-us/azure/app-service/configure-authentication-provider-microsoft When you configure Input Binding click manage
然后选择mIcrosoft帐户
then choose mIcrosoft account
转到此链接 https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade
选择管理个人帐户
注册一个新的应用程序 然后将客户端密码添加到应用程序
register a new application and then add the client secret to the application
并授予其更新权限或对Onedrive进行读写 获取用户ID: 输入您的azure函数URL,如下所示 https://yourfunction.azurewebsites.net/.auth/login/aad
and give it update permission or read write to Onedrive To get the user ID: enter your azure function URL as below to authenticate https://yourfunction.azurewebsites.net/.auth/login/aad
然后访问
https://yourfunction.azurewebsites.net/.auth/me
抢user_id
输入您的outlook.com用户ID,如下所示:
enter your outlook.com user ID as below:
这篇关于Azure Functions中的个人One Drive Microsoft Graph绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!