How to fix Azure Functions failing because of Timeouts

GH 20 Reputation points
2023-05-17T05:19:02.7133333+00:00

Hi,

I am trying to use Azure Functions to Upsert entities to Azure Table Storage.

The problem is, the 'Upsert'ing works just fine (entites are upserted) but the Azure Function itself keeps failing because of Timeouts.

What would I be doing wrong?Timeout

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
170 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,978 questions
{count} votes

Accepted answer
  1. VenkateshDodda-MSFT 20,696 Reputation points Microsoft Employee
    2023-05-18T07:44:16.3366667+00:00

    @GH Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    Based on the shared information, we have looked at the backend logs of your function (AddProfileDataMethod) and we see that function is time out while getting value from Memory stream as shown in below exception.

     Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: AddProfileDataMethod ---> Newtonsoft.Json.JsonSerializationException : Error getting value from 'ReadTimeout' on 'System.IO.MemoryStream'. ---> System.InvalidOperationException : Timeouts are not supported on this stream.    at System.IO.Stream.get_ReadTimeout()
    
    • It looks like you are doing a JSON serialization and it is getting failed as it is not able to serialize as properly. It is a code issue on serialization.
    • I believe in your function, you are making HTTP/SDK call to azure table storage to update/replace the records and in later part of your code you are serializing the response object or some other object that is causing the issue. That is the reason you table is getting updated, but your function is getting failed.
    • Upon further reviewing the logs, I can see your function is executing successfully and looks like you have already fixed the issue.

    In case if you are still facing the issue, please help us in sharing your function code to review and assist you further.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.