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
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.