Azure持久功能示例说不允许使用同步功能 [英] Azure durable functions sample says sync functions are not allowed
问题描述
我正在逐步完成Azure培训.我目前正在查看
在功能"应用程序的设置"选项卡中,我选择了〜2按钮,将运行时版本更改为2.0.xxxx.
此外,为了确保已安装持久功能包,我运行了
npm查看持久功能
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 .
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
这篇关于Azure持久功能示例说不允许使用同步功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!