On graph sdk v4, I use option to set TimeOut to a higher value in Microsoft.Graph GraphServiceClient like bellow.
graphServiceClient.HttpProvider.OverallTimeout = TimeSpan.FromSeconds(10);
However, updating to graph sdk v5, I notice this doesn't supported in our new graph sdk v5. How can I do this in the new graph version? Anyone please help me
Use GraphClientFactory to create a default HttpClient used by SDK and change Timeout.
Then pass the instance of HttpClient to the ctor of GraphServiceClient
var httpClient = GraphClientFactory.Create();
httpClient.Timeout = TimeSpan.FromMinutes(5);
var graphServiceClient = new GraphServiceClient(httpClient, tokenCredential);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With