Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Worker failed to load Durable Entity function when binding a Storage Queue

未关闭
#392 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
python
领域
backend

调研方向

从已复现的 Counter 示例的 init.py 和 function.json 开始,然后跟踪 entity_function 入口点的加载方式,以及其 outputQueueItem 绑定的验证方式。运行本地 reproducer,并比较存在 queue 绑定时的函数加载情况;当 Counter 函数能够通过声明的 Storage Queue 输出成功加载时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Enhancement fixed-in-v2 P3

🐛 Describe the bug

I'm learning about Durable Entities , not sure if this is supported or not. I'm using counter sample provided here and trying to bind a Storage Queue . However worker complains about not finding the corresponding parameter:

[2022-07-22T15:02:30.124Z] Worker failed to load function: 'Counter' with function id: 'a80f6d9c-8814-4549-bc62-155546eaf880'.
[2022-07-22T15:02:30.125Z] Result: Failure
Exception: FunctionLoadError: cannot load the Counter function: the following parameters are declared in function.json but not in Python: {'outputQueueItem'}

🤔 Expected behavior

What should have happened?
Worker is able to load Function

☕ Steps to reproduce

What Durable Functions patterns are you using, if any?
HTTPTrigger > Orchestration > Entity

Any minimal reproducer we can use?
https://github.com/enriqueayala/azure-function-counter.git

_ init.py _

import logging
import json

import azure.functions as func
import azure.durable_functions as df


def entity_function(context: df.DurableEntityContext, outputQueueItem: func.Out[str]):
    """A Counter Durable Entity.
    A simple example of a Durable Entity that implements
    a simple counter.
    Parameters
    ----------
    context (df.DurableEntityContext):
        The Durable Entity context, which exports an API
        for implementing durable entities.
    """

    current_value = context.get_state(lambda: 0)
    operation = context.operation_name
    if operation == "add":
        amount = context.get_input()
        current_value += amount
    elif operation == "reset":
        current_value = 0
    elif operation == "get":
        pass
    
    context.set_state(current_value)
    context.set_result(current_value)
    outputQueueItem.set(current_value)


main = df.Entity.create(entity_function)

function.json

{
  "scriptFile": "__init__.py",
  "bindings": [
    {
      "name": "context",
      "type": "entityTrigger",
      "direction": "in"
    },
    {
      "type": "queue",
      "direction": "out",
      "name": "outputQueueItem",
      "queueName": "outqueue",
      "connection": "AzureWebJobsStorage"
    }
  ]
}

Are you running this locally or on Azure?
Locally

主要语言
Python
星标
157
派生
70
PR 合并指标
30 天内没有已合并 PR

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/azure-functions-durable-python 的其他 Issue

查看 Azure/azure-functions-durable-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。