我正在逐步完成 Azure 培训。我目前正在看https://learn.microsoft.com/en-us/learn/modules/create-long-running-serverless-workflow-with-durable-functions/4-exercise-create-a-workflow-using-durable-functions https://learn.microsoft.com/en-us/learn/modules/create-long-running-serverless-workflow-with-durable-functions/4-exercise-create-a-workflow-using-durable-functions .
当我进入“验证持久功能工作流程是否启动”时,我注意到出了问题。我得到的不是它预测的 json 响应,而是一个空白屏幕。然后,我检查了 HttpStart 函数的日志,我看到了以下内容:
Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead.
我不确定我会在哪里做到这一点,但此时我浏览了之前的所有说明来寻找差异。我唯一注意到的是,在说明中,它显示了 HttpStart 的“function.json”应该是什么样子,我注意到它有这个:
"authLevel": "anonymous",
但我有这个:
"authLevel": "function",
无论如何,我所拥有的似乎更正确,所以我认为说明中显示的内容是不正确的。
我还注意到说明描述了安装“Azure DurableTask 扩展”,但我没有看到任何安装此扩展的提示。
我没有看到与说明有任何其他差异。
然后我用谷歌搜索了错误消息。以下内容似乎相关,但我不知道这如何或是否真正适用:https://github.com/dotnet/aspnetcore/issues/7644 https://github.com/dotnet/aspnetcore/issues/7644 .
忘记我上面关于恢复到版本 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
另外,为了确保安装了持久功能包,我运行了
npm 查看持久功能
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)