首页 > 解决方案 > Azure 持久编排功能不存在、已禁用或不是编排功能

问题描述

Azure Durable HttpStart 在client.start_new(req.route_params["functionName"], None, None)函数调用时失败。

函数应用程序可以在本地开发环境中工作,即使在 docker 容器中也是如此。将其部署到 Azure Kubernetes 服务后,HttpStart 函数无法启动 Orchestration Function。

日志跟踪:

Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: Functions.DurableFunctionsHttpStart
 ---> Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException: Result: Failure
Exception: Exception: The function 'DurableFunctionsOrchestrator' doesn't exist, is disabled, or is not an orchestrator function. Additional info: No orchestrator functions are currently registered!
Stack:   File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/dispatcher.py", line 338, in _handle__invocation_request
    call_result = await fi.func(**args)
  File "/home/site/wwwroot/DurableFunctionsHttpStart/__init__.py", line 16, in main
    instance_id = await client.start_new(req.route_params["functionName"], None, None)
  File "/usr/local/lib/python3.7/site-packages/azure/durable_functions/models/DurableOrchestrationClient.py", line 82, in start_new
    raise Exception(exception_message)

系统总览:

Function runtime: 3.0.2630
Python version: 3.7.7
azure-functions: 1.3.1
azure-functions-durable: 1.0.0b9/1.0.0b7
Kubernetes version: 1.17.11
Node size: Standard_DS2_v2
OS type: Linux

码头工人文件:

FROM mcr.microsoft.com/azure-functions/python:3.0-python3.7

ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureFunctionsJobHost__Logging__Console__IsEnabled=true \
    WEBSITE_HOSTNAME=<ip-address>:<port>

COPY requirements.txt /
RUN pip install -r /requirements.txt

COPY . /home/site/wwwroot

再现场景:

  1. 从 VSCode 创建一个 Durable Function HttpStart 应用程序。
  2. 使用func init --docker-only命令
  3. 码头工人命令az acr build --registry yourRegistryName --image durableFunction:v1 .
  4. 在 AKS 中部署func kubernetes deploy --name durableFunction --namespace yourNameSpace --service-type ClusterIP --registry yourRegistryName

功能应用程序正常启动,但在 http post 请求中失败。但是,同样的 contaninarized 函数应用在 Azure 托管函数应用中运行。

两年前曾报道过类似的问题,但现在正在发生。

标签: azuredockerkubernetesazure-durable-functionsazure-container-registry

解决方案


推荐阅读