Azure / azure-functions-core-tools

Command line tools for Azure Functions
MIT License
1.32k stars 434 forks source link

Python -m v2 programming model will not start by default on HTTP trigger without AzureWebJobsStorage #3182

Open paulyuk opened 2 years ago

paulyuk commented 2 years ago

Core Tools Version: 4.0.4829 Commit hash: N/A (64-bit) << using Rosetta and x64 core tools (not a mac M1 bug) Function Runtime Version: 4.11.2.19273 OS: MacOS Monterey 12.6, Mac M1 Pro

In the new programming model, I feel it's a regression that HTTP triggers require AzureWebJobStorage. As a result the default func init func start flow fails, and you need to fulfill the storage account either with a real resource or azurite. This impacts the default case, and the top 1-2 triggers.

Can we please revisit?

Repro

 paulyuk@Pauls-MBP-2  ~/src/functions/trynewpythonmodel1  func init --worker-runtime python -m v2
Found Python version 3.9.6 (python3).
The new Python programming model is in public preview. Learn more at https://aka.ms/pythonprogrammingmodel
Writing requirements.txt
Writing function_app.py
Writing .gitignore
Writing host.json
Writing local.settings.json
Writing /Users/paulyuk/src/functions/trynewpythonmodel1/.vscode/extensions.json

 ✘ paulyuk@Pauls-MBP-2  ~/src/functions/trynewpythonmodel1  pip3 install -r requirements.txt 
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: azure-functions in /Users/paulyuk/Library/Python/3.9/lib/python/site-packages (from -r requirements.txt (line 5)) (1.12.0)
WARNING: You are using pip version 21.2.4; however, version 22.3 is available.
You should consider upgrading via the '/Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pip' command.

 paulyuk@Pauls-MBP-2  ~/src/functions/trynewpythonmodel1  func start
Found Python version 3.9.6 (python3).

Azure Functions Core Tools
Core Tools Version:       4.0.4829 Commit hash: N/A  (64-bit)
Function Runtime Version: 4.11.2.19273

[2022-10-21T20:21:35.901Z] A host error has occurred during startup operation '65491219-bd78-4cc3-9270-69c490fb4d3a'.
[2022-10-21T20:21:35.903Z] Microsoft.Azure.WebJobs.Extensions.DurableTask: Unable to resolve the Azure Storage connection named 'Storage'.
Value cannot be null. (Parameter 'provider')

Note, I'm also surprised the model is trying to use DurableTasks here and errors out on that. Why is that a new dependency?

ejizba commented 2 years ago

Likely a duplicate of https://github.com/Azure/azure-functions-host/issues/8870

paulyuk commented 1 year ago

@shreyabatra4