Creating Durable Functions HTTP Start and debugging locally resulted in Exception: ModuleNotFoundError: No module named 'azure.functions.decorators'.

Nico Wijaya 45 Reputation points
2023-08-31T13:43:01.1433333+00:00

Hi Experts,

I'm trying to create my first durable function in Python 3.8 by following this docs below:

https://learn.microsoft.com/en-us/azure/azure-functions/durable/quickstart-python-vscode?tabs=windows%2Cazure-cli-set-indexing-flag&pivots=python-mode-configuration#install-azure-functions-durable-from-pypi

I already have an existing local Azure Functions project, so I skipped the "Create your local project" section.

I created the orchestrator function with this name, durable_functions_orchestrator. Created the activity function with this name, durable_functions_activity. Created the the Client Function (HTTP starter) with this name, durable_functions_http_start.

When I started testing the function locally and it asks Azure Storage Account to run on, I chose an existing Storage Account I've been using for the other Functions too. I've also added the connection string to that Storage Account under the AzureWebJobsStorage of local.settings.json file.

User's image

However, when I started debugging it always ended with this error below.

Result: Failure

Exception: ModuleNotFoundError: No module named 'azure.functions.decorators'.User's image

I checked and ensure I'm using the correct venv and it has the latest version of azure-functions & azure-functions-durable, but the problem persists.
User's image

I originally thought my venv was corrupted by package version conflicts. I deleted the venv from scratch, reinstall the latest packages from the requirements.txt. I even tried deleting the .vscode folder under my working directory, but nothing seemed to solve the issue.

I tried following what's in this link below but nothing worked.

https://learn.microsoft.com/en-us/azure/azure-functions/recover-python-functions?tabs=vscode%2Cbash&pivots=python-mode-configuration#troubleshoot-modulenotfounderror

Would you be able to help advising what I did wrong please? Thanks in advance for your help.

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

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2023-09-05T13:47:20.64+00:00

    Nico Wijaya Thanks for sharing the info. In V2 programming model, triggers and bindings are represented as decorators. As per Requirements doc, you need to have minimum Azure Functions Core Tools version v.4.0.5095+ for running locally, you have older version (latest: 4.0.5198).

    Suggest you update it to the latest and follow Enable v2 programming model step to set AzureWebJobsFeatureFlags. Let me know if you still face the issue after that.

    1 person found this answer helpful.

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.