Error when doing query for drives on Sharepoint using Microsoft Graph in C#

Copper Contributor

I have this line of code

Screenshot 2023-12-01 at 15.20.20.png

 

Running on an app registration with these permissions

Screenshot 2023-12-01 at 15.21.36.png

 

 

In a basic .NET Core 7 app with added Microsoft.Graph client configured like this

Screenshot 2023-12-01 at 15.23.51.png

 

Sometimes this finds a drive for a given folderName successfully and other times, for the exact same folder name, it throws a general exception.

 

It returns exception:

General exception while processing at 

  • Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.ThrowIfFailedResponse(HttpResponseMessage response, Dictionary`2 errorMapping, Activity activityForAttributes, CancellationToken cancellationToken) at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)
       at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)
       at Microsoft.Graph.Drives.Item.SearchWithQ.SearchWithQRequestBuilder.GetAsSearchWithQGetResponseAsync(Action`1 requestConfiguration, CancellationToken cancellationToken)

 

What am I missing?

Thanks in advance!

1 Reply

For anyone interested, downgrading our Microsoft.Graph package to 4.48 resolved this issue. The bug is on Microsofts side and was introduced sometime after version 4.48. Hope this gets addressed by Microsoft soon.