azure - 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
再现场景:
- 从 VSCode 创建一个 Durable Function HttpStart 应用程序。
- 使用
func init --docker-only
命令 - 码头工人命令
az acr build --registry yourRegistryName --image durableFunction:v1 .
- 在 AKS 中部署
func kubernetes deploy --name durableFunction --namespace yourNameSpace --service-type ClusterIP --registry yourRegistryName
功能应用程序正常启动,但在 http post 请求中失败。但是,同样的 contaninarized 函数应用在 Azure 托管函数应用中运行。
两年前曾报道过类似的问题,但现在正在发生。
解决方案
推荐阅读
- c# - 通过 Linq 和 EF 选择链接表的空列表
- android - Android studio error - react native using firebase
- greenplum - 表greenplum数据库中缺少分布键
- excel - 如何从 maatwebsite/Excel 向集合添加额外数据
- git - 如何获取 github 文件的查询 url?
- python - 在尝试粘贴时,使用 tkinter 从 Windows 10 中的 Python 3.4 复制到剪贴板会导致崩溃
- android - simd 是否包含在 Android NDK 中
- python - python从套接字流接收图像
- javascript - Nodejs发布未访问文件所在的目录
- javascript - 单击添加按钮后元素立即消失