I'm stepping through Azure training. I'm currently looking at https://docs.microsoft.com/en-us/learn/modules/create-long-running-serverless-workflow-with-durable-functions/4-exercise-create-a-workflow-using-durable-functions .
When I got to "Verify that the durable functions workflow starts" I noticed something was wrong. Instead of the json response that it predicted, I got a blank screen. Then, I checked the log of the HttpStart function, and I saw this:
Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead.
I'm not sure where I would do that, but at this point I went through all of the previous instructions looking for variances. The only thing I noticed was that in the instructions, where it showed what the "function.json" for HttpStart should look like, I noticed it had this:
"authLevel": "anonymous",
But I had this:
"authLevel": "function",
What I have seems more correct, in any case, so I think what was shown in the instructions was incorrect.
I also noticed that the instructions described installing the "Azure DurableTask extension", but I didn't see any prompt to install this.
I didn't see any other variances from the instructions.
I then googled the error message. The following seems relevant, but I don't know how or whether this really applies: https://github.com/dotnet/aspnetcore/issues/7644 .
Add functions to the appRight-click the project in Visual Studio and select Add > New Azure Function. Verify Azure Function is selected from the add menu, enter a name for your C# file, and then select Add. Select the Durable Functions Orchestration template and then select Add.
Azure HTTP authorization level, Determines what keys, if any, need to be present on the request in order to invoke the function.
forget the last sentence of my comment above regarding reverting to version 2.
I have changed my runtime version to version 2 and this time the HTTP Trigger was successful in running. To change the runtime version, I clicked on the "Function App settings" link underneath the Configured features heading on the Overview tab of the durable function I created
In the Function app settings tab, I selected the ~2 button to change the runtime version to 2.0.xxxx
Also, just to make sure the durable functions package was installed, I ran
npm view durable-functions
Another workaround without changing the azure SDK version is to add a compatibility app setting and setting it to true.
Go to:
This seems to do the trick while the azure-functions-durable package gets this fixed to deal with synchronous calls within the library, see the issue on GitHub
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