I get timeout error frequently with the below code using the Microsoft.Graph package,
await graphServiceClient.Users[UserId].Contacts.Request().AddAsync(contact);
As there are no option (that I could find) for adding multiple contacts at a time, I was calling the above LOC parallel. I have around say 500 contacts to import and many of them fails giving the timeout response
Exception: Code: timeout Message: The request timed out.
Are there any option to set TimeOut to a higher value in Microsoft.Graph GraphServiceClient?
You can set the Timeout to a higher value like this: For example to set the Timeout to one hour:
graphServiceClient.HttpProvider.OverallTimeout = TimeSpan.FromHours(1);
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