Minimal durable entity function - can't get it to work: The function 'xxx' doesn't exist

ZZ 80 Reputation points
2025-02-03T17:05:17.7866667+00:00

I copied this repository to set up a minimal durable entity function project but I am getting errors.

https://github.com/Azure/azure-functions-durable-python/tree/dev/samples/counter_entity

Code structure like this, and I want to stress that I didn't change any code from how it is distributed.

Screenshot from 2025-02-03 17-00-11

I have exactly the same folder structure, exactly the same code and configuration except my local.settings.json has a AzureWebJobsStorage that uses my own storage account connection string.

I then run 'func host start', then put this URL into my browser: [http://localhost:7071/api/orchestrators/Counter]

I get 500 internal error:

[2025-02-03T16:04:00.128Z] Executed 'Functions.DurableTrigger' (Failed, Id=b5911178-fb1a-4e46-bd92-6e0857a498c0, Duration=243ms)
[2025-02-03T16:04:00.129Z] System.Private.CoreLib: Exception while executing function: Functions.DurableTrigger. System.Private.CoreLib: Result: Failure
[2025-02-03T16:04:00.129Z] Exception: Exception: The function 'Counter' doesn't exist, is disabled, or is not an orchestrator function. Additional info: The following are the known orchestrator functions: 'DurableOrchestration'.
[2025-02-03T16:04:00.129Z] Stack:   File "/usr/lib/azure-functions-core-tools-4/workers/python/3.10/LINUX/X64/azure_functions_worker/dispatcher.py", line 659, in _handle__invocation_request

Python libraries:

azure-core              1.32.0      Microsoft Azure Core Library for Python
azure-functions         1.21.3      Azure Functions for Python
azure-functions-durable 1.2.10      Durable Functions For Python

Also I checked my storage account and I can see a few TestHubNameXXX are created in table/queue/blob. I assume they are generated by the durable function app.

Is it not possible to test durable entities locally?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,578 questions
0 comments No comments
{count} votes

Accepted answer
  1. LeelaRajeshSayana-MSFT 17,331 Reputation points
    2025-02-03T22:36:18.15+00:00

    Hi @ZZ Thank you for posting the question on this platform.

    You are calling the wrong end point URL which is resulting in this error. If you look at the method signature of Counter and DurableOrchestation you will know that there is a difference between how there are defined and each server a different purpose.

    Counter is defined as def entity_function(context: df.DurableEntityContext): It represents the context object for the entity function. It provides access to the entity's state, the name of the operation being performed, and any input parameters. It is used to manage the state of the entity and perform operations like adding to the counter, resetting it, or retrieving its current value

    DurableOrchestration on the other hand is defined as def orchestrator_function(context: df.DurableOrchestrationContext): which represents the context object for the orchestration function. It provides access to the orchestration's state, history, and API for calling activity functions, signaling entities, and managing timers. It is essential for coordinating the workflow of the orchestration.

    Since the endpoint http://localhost:7071/api/orchestrators/{functionName} expects an Orchestration function, it errors out when you point to Entity context. You would need to pass the DurableOrchestration while calling the end-point

    http://127.0.0.1:7071/api/orchestrators/DurableOrchestration

    You can retrieve the state of the Counter by calling the end-point http://localhost:7071/api/entity/Counter/myCounter. You would get a result similar to this

    enter image description here

    Hope this helps!


    If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.