How to have python v2 durable functions in multiple python files

Paul Robert Wittig 0 Reputation points
2023-03-14T20:27:33.0533333+00:00

Hello! Super keen to refactor our code to use the new Azure Function Python V2 Programming Model. However, stuck on importing our activities. There are no examples that show how to import activities in other files. Can you please revise the documentation. Is it at all possible to have other python files aside from function_app.py, unless it is a blueprint? Blueprints unfortunately don't work with Durable Functions, it seems. Blueprints do not have the durable_client_input that DurableOrchestrationClient does in azure.durable_functions DFApp provides. So right now we are seemingly blocked from switching to V2 because we have multiple complicated orchestrators that we want to keep in separate folders. Our function_app.py file will grow crazy big if we can't import the activities/orchestrators sitting in subfolders.

Either I'm totally missing a way to do this or there is simply no way without waiting for blueprints to support it.

I've tried passing DFApp as an input to a class in the other folder but nothing is working.

Thanks!

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

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2023-03-22T15:26:51.7366667+00:00

    Paul Robert Wittig Thank you for posting your question in Microsoft Q&A. Sorry for the delay in response.

    #1 - I understand it would be great to have examples and I suggest you file feedback for this via docs (GitHub) here. I will also pass the feedback internally with our docs/product team.

    #2 - Currently, the plan is to add support for blueprints before GA. Yes, you can have other python files and import them in durable functions as mentioned in this comment. Please try and let me know if you face any issues.

    Durable functions provide preview support of V2 model, and make sure to install the latest Durable Functions SDK (>=1.2.2). If you have any feedback or suggestions on the product, please submit it via Durable Functions SDK for Python repo. We welcome your feedback and would really help in improving our products.

    I hope this helps with your questions and let me know for any other.

    0 comments No comments

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.