-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After upgrade to Graph .NET SDK 5 with the removal of "Request()", the usageRights object is no longer available from the users[id] API #2351
Comments
Thanks for raising this @jimbarrett33 I believe the code should look something like var usageRights = await graphClient.Users["user-id"].UsageRights
.GetAsync( requestConfiguration => requestConfiguration.QueryParameters.Filter = "filter expression"); Any chance you can confirm how you are creating the |
@andrueastman Thanks for the quick reply. It turned out that my package imports were not resolving to beta client so I was able to get past the error by fixing that and your code above. Thanks for that. Now I am faced with the issue of configuring the service for dependency injection. Below is code that used to work and updated code using the latest SDK, which results in an error. Before
After
Notice the change to use Compile Error Note that if I use the "Before" code with Note also that I am implementing the behalf-of-flow for the API using You have any ideas how to make this work? I think this may eventually help others too. I have an office-js add-in that implements SSO and the OBO flow with code initially based off of this article https://learn.microsoft.com/en-us/office/dev/add-ins/develop/create-sso-office-add-ins-aspnet#configure-microsoft-graph-and-obo-flow Also, regarding that article, it seems that the Thanks again. |
@andrueastman One other thing is related to the retryHandlerOption not working. I simulated 500 errors locally using devProxy tool and the retries never happen. My code is verbatim to the code below which is the exact example from https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/upgrade-to-v5.md#per-request-options I am using the
|
Any chance the following docs are helpful? This may need to change from builder.Services.AddMicrosoftIdentityWebApiAuthentication(builder.Configuration)
.EnableTokenAcquisitionToCallDownstreamApi()
.AddMicrosoftGraphBeta(builder.Configuration.GetSection("DownstreamApi"))
.AddInMemoryTokenCaches(); to builder.Services.AddMicrosoftGraph(options =>
services.Configuration.GetSection("DownstreamApis:MicrosoftGraph").Bind(options) ); |
Following up in #2357 |
We are also having issues with the usageRights API (https://github.com/microsoftgraph/microsoft-graph-docs-contrib/issues/8879) and based on your feedback @jimbarrett33 regarding reliability we are wondering what is the current recommended approach the verify usageRights in a SPFx webpart or Office-addin. |
@gruering I'm not sure if this will be of any help but I found my issues with the I opened this issue /microsoftgraph/microsoft-graph-docs-contrib/issues/9203 which was immediately closed by automation because it was started from inside MS docs. I did not get anywhere with Azure support either. I am looking to connect with others that are using the |
Yes I am very interested and also curious to know how you are accessing the usageRights API. Can you share some details about that? We are having troubles to access the usageRights API in multi-tenant scenarios (response is always empty) |
@gruering Sure. I would prefer not to share here though. If you want to shoot me an email at jim@strivetech.com we can discuss or setup a meeting. |
Describe the Problem
In a ASP.NET 6 Core app, I was/am using the Graph Beta endpoint where the usageRights API is (only) available (it's been in beta for a long time).
Before the upgrade to Graph SDK 5 this code worked:
After upgrade to Graph SDK 5, and the removal of the Request() from the fluent API, this code does not compile:
Error CS1061'UserItemRequestBuilder' does not contain a definition for 'UsageRights' and no accessible extension method 'UsageRights' accepting a first argument of type 'UserItemRequestBuilder' could be found (are you missing a using directive or an assembly reference?)
To Reproduce
Microsoft.Identity.Web.GraphServiceClientBeta
Expected behavior
I expect the usageRights object/API to be available like before.
Screenshots
Desktop (please complete the following information):
Additional context
I am trying to upgrade to keep current and also use the new Retry interface but seem to be blocked now. I guess I could use the REST endpoint directly but I want to keep using the SDK for code consistency.
The text was updated successfully, but these errors were encountered: