You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Durable Functions示例运行出现NotFound错误求助

Troubleshooting "NotFound" Error When Accessing Durable Functions Orchestrator Endpoint

我之前调试Durable Functions示例时也碰到过一模一样的问题,结合Durable Functions的运行机制,给你梳理几个最可能的原因和对应的解决办法:

1. 确认Orchestrator函数的命名与路由匹配

首先得检查你的Orchestrator函数的[FunctionName]属性是不是准确设置为E1_HelloSequence——有时候复制示例代码时可能不小心改了名称,或者拼写错误:

[FunctionName("E1_HelloSequence")] // 这里的名称必须和URL里的一致
public static async Task<List<string>> RunOrchestrator(
    [OrchestrationTrigger] IDurableOrchestrationContext context)
{
    // 函数逻辑...
}

同时也要检查HttpStart触发器的路由模板是否正确,确保它的Route参数是orchestrators/{functionName},这样才能正确匹配请求:

[FunctionName("HttpStart")]
public static async Task<HttpResponseMessage> HttpStart(
    [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = "orchestrators/{functionName}")] HttpRequestMessage req,
    [DurableClient] IDurableOrchestrationClient starter,
    string functionName,
    ILogger log)
{
    // 启动Orchestrator的逻辑...
}

2. 检查函数是否被主机正确加载

有时候CLI显示主机初始化完成,但实际上Orchestrator函数可能因为编译错误、依赖缺失没被加载。你可以翻一翻CLI的启动日志,找有没有类似Loaded function 'E1_HelloSequence'的条目:

  • 如果没有的话,先清理你的解决方案(Visual Studio右键解决方案→清理),然后重新编译生成;
  • 确认Microsoft.Azure.WebJobs.Extensions.DurableTask这个NuGet包已经正确安装,版本和文档要求的兼容,没有版本冲突。

3. 验证请求细节与函数配置

  • 虽然你的日志显示用的是GET请求,但可以再确认下HttpStart的HttpTrigger属性里是否包含了"get"方法;如果没问题,也可以尝试用POST请求访问试试(有些示例默认可能更倾向于POST启动Orchestrator);
  • 注意URL里的E1_HelloSequence大小写要和函数名完全一致,函数名称是区分大小写的,哪怕是本地Windows环境也可能出现匹配问题。

4. 检查本地运行的配置文件

Durable Functions依赖存储账户来管理状态,哪怕本地运行也需要:

  • 打开local.settings.json,确认AzureWebJobsStorage设置为UseDevelopmentStorage=true,并且Azure存储模拟器已经启动;
  • 同时确认FUNCTIONS_WORKER_RUNTIME设置为dotnet,和你的C#项目匹配。

如果以上方法都试过还是没解决,可以把Orchestrator和HttpStart的完整代码片段,以及CLI的完整启动日志贴出来,这样能更精准地排查问题。

内容的提问来源于stack exchange,提问作者Murray Foxcroft

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:23:27