我按照 quickstart-python-vscode 部署了一个示例 Durable Functions 应用程序。
当我尝试调用
/api/orchestrators/hello_orchestrator
端点时,出现以下错误:
2025-01-07T09:28:05Z [Verbose] Request successfully matched the route with name 'http_start' and template 'api/orchestrators/{functionName}'
2025-01-07T09:28:05Z [Verbose] AuthenticationScheme: WebJobsAuthLevel was not authenticated.
2025-01-07T09:28:05Z [Verbose] AuthenticationScheme: Bearer was not authenticated.
2025-01-07T09:28:05Z [Information] Authorization failed. These requirements were not met:
Microsoft.Azure.WebJobs.Script.WebHost.Security.Authorization.FunctionAuthorizationRequirement
2025-01-07T09:28:05Z [Information] Executing StatusCodeResult, setting HTTP status code 401
这个神秘的错误消息意味着我在
x-functions-key
标头中传递了错误的、过时的功能键。
使用“功能应用程序/应用程序密钥”中的最新密钥解决了问题。