Singletons for Durable python functions in Azure Functions v2

Benedikt Schmitt 120 Reputation points
2025-03-31T13:53:05.5566667+00:00

Hello,

I would be really interested to implement Singletons in my Durable Function. However the documentation for python Functions only shows how to do it in Azure Functions v1. I need it for v2.

Does this functionality not exist for Azure Functions v2 yet?

This is the documentation I am referring to:

https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-singletons?tabs=python

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

1 answer

Sort by: Most helpful
  1. Ranashekar Guda 1,265 Reputation points Microsoft External Staff
    2025-04-01T14:00:40.91+00:00

    Hi @Benedikt Schmitt,
    The documentation currently does not provide specific guidance on implementing Singletons for Durable Functions in Azure Functions v2 using Python. The concept of singletons in Durable Functions is applicable, and you can create a singleton orchestrator by assigning a specific instance ID to the orchestrator when creating it. This ensures that only one instance of the orchestrator runs at a time.

    For Python, you can use the Durable Functions 2.0 features, which include entity functions that can help manage stateful workflows. While the specific singleton implementation details for Python in v2 may not be explicitly documented, you can refer to the general principles of Durable Functions and adapt them to your needs.
    For further clarification, please refer to the following documentations: Document1, Document2
    I hope this helps resolve your issue. Feel free to reach out if you have further concerns.

    1 person found this answer 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.