Azure-docs: DurableTask no longer needed?

Created on 18 Feb 2020  Â·  12Comments  Â·  Source: MicrosoftDocs/azure-docs

I have been going through the azure developer associate certification training path and during that process they have us create a number of functions. When I get to the durable functions section I have been getting an error (details below). The error appears to be related to the DurableTask dependency and I have noticed both this page and the training module expect an "Extension not installed" window to appear when selecting the Durable Functions Http Starter, however this is not displayed (I have gone through this in fresh resource groups three times). Perhaps it once was but isn't anymore?

Is this step in the process no longer necessary?

When I enter the Http start function url into a browser, I get a server 500 error.
Stacktrace:
2020-02-18T17:42:47.453 [Information] Executing 'Functions.HttpStart' (Reason='This function was programmatically called via the host APIs.', Id=c3e23e07-5f8d-4fb7-8475-9220ed7ce6ba)
2020-02-18T17:42:47.529 [Error] Executed 'Functions.HttpStart' (Failed, Id=c3e23e07-5f8d-4fb7-8475-9220ed7ce6ba)
Result: Failure
Exception: Error: The operation failed with an unexpected status code: 500. Details: {"Message":"Something went wrong while processing your request","ExceptionMessage":"Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead.","ExceptionType":"System.InvalidOperationException","StackTrace":" at Microsoft.AspNetCore.Server.IIS.Core.HttpRequestStream.Read(Byte[] buffer, Int32 offset, Int32 count)\r\n at Microsoft.AspNetCore.Server.IIS.Core.WrappingStream.Read(Byte[] buffer, Int32 offset, Int32 count)\r\n at System.Net.Http.DelegatingStream.Read(Byte[] buffer, Int32 offset, Int32 count)\r\n at System.IO.StreamReader.ReadBuffer(Span1 userBuffer, Boolean& readToUserBuffer)\r\n at System.IO.StreamReader.ReadSpan(Span1 buffer)\r\n at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)\r\n at Newtonsoft.Json.JsonTextReader.ReadData(Boolean append, Int32 charsRequired)\r\n at Newtonsoft.Json.JsonTextReader.ParseValue()\r\n at Newtonsoft.Json.JsonTextReader.Read()\r\n at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)\r\n at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.DeserializeT\r\n at Microsoft.Azure.WebJobs.Extensions.DurableTask.HttpApiHandler.HandleStartOrchestratorRequestAsync(HttpRequestMessage request, String functionName, String instanceId) in C:\GitHub\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\HttpApiHandler.cs:line 490\r\n at Microsoft.Azure.WebJobs.Extensions.DurableTask.HttpApiHandler.HandleRequestAsync(HttpRequestMessage request) in C:\GitHub\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\HttpApiHandler.cs:line 152"}
Stack: Error: The operation failed with an unexpected status code: 500. Details: {"Message":"Something went wrong while processing your request","ExceptionMessage":"Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead.","ExceptionType":"System.InvalidOperationException","StackTrace":" at Microsoft.AspNetCore.Server.IIS.Core.HttpRequestStream.Read(Byte[] buffer, Int32 offset, Int32 count)\r\n at Microsoft.AspNetCore.Server.IIS.Core.WrappingStream.Read(Byte[] buffer, Int32 offset, Int32 count)\r\n at System.Net.Http.DelegatingStream.Read(Byte[] buffer, Int32 offset, Int32 count)\r\n at System.IO.StreamReader.ReadBuffer(Span1 userBuffer, Boolean& readToUserBuffer)\r\n at System.IO.StreamReader.ReadSpan(Span1 buffer)\r\n at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)\r\n at Newtonsoft.Json.JsonTextReader.ReadData(Boolean append, Int32 charsRequired)\r\n at Newtonsoft.Json.JsonTextReader.ParseValue()\r\n at Newtonsoft.Json.JsonTextReader.Read()\r\n at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)\r\n at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.DeserializeT\r\n at Microsoft.Azure.WebJobs.Extensions.DurableTask.HttpApiHandler.HandleStartOrchestratorRequestAsync(HttpRequestMessage request, String functionName, String instanceId) in C:\GitHub\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\HttpApiHandler.cs:line 490\r\n at Microsoft.Azure.WebJobs.Extensions.DurableTask.HttpApiHandler.HandleRequestAsync(HttpRequestMessage request) in C:\GitHub\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\HttpApiHandler.cs:line 152"}
at DurableOrchestrationClient.createGenericError (D:\home\site\wwwroot\node_modules\durable-functions\lib\src\durableorchestrationclient.js:587:16)
at DurableOrchestrationClient.<anonymous> (D:\home\site\wwwroot\node_modules\durable-functions\lib\src\durableorchestrationclient.js:401:44)
at Generator.next (<anonymous>)
at fulfilled (D:\home\site\wwwroot\node_modules\durable-functions\lib\src\durableorchestrationclient.js:4:58)
at process._tickCallback (internal/process/next_tick.js:68:7)


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 azure-functionsvc cxp doc-bug triaged

Most helpful comment

I found this stack post about the error.

It turns out the default version for azure functions is version 3 and that has a breaking change. If you change to version 2 you should be fine.

From Overview tab, select Function app settings, then change the version.

All 12 comments

@RyanMannix Thanks for the feedback! We are currently investigating and will update you shortly.

Hi any news on this? I have the same problem i.e. cannot complete the online-training on A functions. Actually - even if i leave the code from templates (that should work from the start) the same problem appears

I found this stack post about the error.

It turns out the default version for azure functions is version 3 and that has a breaking change. If you change to version 2 you should be fine.

From Overview tab, select Function app settings, then change the version.

cc: @cgillum for guidance

We may also need to update the tutorial referenced in this Stackoverflow post as well.

Also related: #48822

Hmm - what about durable functions in version 3 then? Is anybody taking care of it? Workaround for training is fine, but for production use is not - version 3 should also be working with durable functions. Is there a ticket for this

Any news on this topic? The tutorial was not updated and the issue still reproduces.

Hi, I also got same error but when I changed my function version to 2 that problem solved. But for Function App 3 what is the recommended approach?

cc: @anthonychu

This problem is being tracked here: https://github.com/Azure/azure-functions-durable-js/issues/148. Unfortunately we are currently blocked from making the updates necessary to fix this automatically on the product side. Switching to use the v2 runtime is one way to work around this. Another workaround for now is to set an app setting named FUNCTIONS_V2_COMPATIBILITY_MODE to true. We've already documented this workaround in our JS quickstart guide.

@anthonychu would you be able to apply your docs update to the Azure Portal tutorial?

@mike-urnun-msft do you know how we can update the impacted learn module(s) to include the workaround(s) mentioned above (whichever one makes more sense for that particular context)? I'm not familiar with these modules or how to update them.

I have it on my list to update the Learn module this week, I know how to do it. The portal tutorial should need the same extra steps. I can update that too. But if there’s anyone who can help with updating these, let me know.

@anthonychu I can help with the changes needed for the portal tutorial

Thanks @mike-urnun-msft. Here's the setting that we should guide the user to make in the portal: https://docs.microsoft.com/en-us/azure/azure-functions/durable/quickstart-js-vscode#enable-azure-functions-v2-compatibility-mode

I'm working on adding the same to the Learn module.

Sorry about the delay. I've added a step about the FUNCTIONS_V2_COMPATIBILITY_MODE setting on the javascript section.

We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JamesDLD picture JamesDLD  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments