带有服务/守护程序的Microsoft Graph CSharp SDK和OneDrive for Business-配额方面返回null [英] Microsoft Graph CSharp SDK and OneDrive for Business with a Service/Daemon application - Quota facet returns null

查看:41
本文介绍了带有服务/守护程序的Microsoft Graph CSharp SDK和OneDrive for Business-配额方面返回null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在针对OneDrive for BusinessMicrosoft Graph CSharp SDK进行编码,并且我正尝试提取特定User上的数据并请求返回Quota信息.

I am coding against Microsoft Graph CSharp SDK for OneDrive for Business and I am trying to pull back data on a specific User and request back Quota information.

我的请求:

var user = await graphServiceClient.Users["test@test.onmicrosoft.com"].Request().GetAsync();
var drive = await graphServiceClient.Drives["test@test.onmicrosoft.com"].Request().GetAsync();
var quotaTotal = drive.Quota.Used;
var displayName = user.DisplayName;
var driveType = drive.DriveType;
var driveId = drive.Id;

问题-返回的数据全部为null. Microsoft Graph SDK是否支持回退OneDrive for Bussiness帐户的Quota构面?

The problem - the data that is returned is all null. Does the Microsoft Graph SDK have support to pull back Quota facet for OneDrive for Bussiness accounts?

更新

我还提供了client_idclient_secrettenant_name以在应用程序级权限上进行身份验证.

I am also providing the client_id, client_secret, and tenant_nameto authenticate on an application-level permission.

更新

drive添加了屏幕截图,因为它返回了所有null.

Added a screenshot for drive since it returns all null.

推荐答案

感谢您报告此问题.如果令牌中包含Files.Read.All或Files.ReadWrite.All范围,则确实不会为App Only调用返回配额和所有者信息.我已经解决了这个问题,该修复程序应该很快就会投入生产. 不过,作为解决方法,您可以为您的应用程序使用Sites.FullControl.All范围,并且该范围应返回配额和所有者信息.

Thanks for reporting the issue. The quota and owner information was indeed not being returned for App Only calls if you had Files.Read.All or Files.ReadWrite.All scope in the token. I have fixed the issue and the fix should roll out to Production soon. As a workaround though, you can use Sites.FullControl.All scope for your app and that should return the quota and owner information.

这篇关于带有服务/守护程序的Microsoft Graph CSharp SDK和OneDrive for Business-配额方面返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆