azure-functions-python-worker
azure-functions-python-worker copied to clipboard
```func new``` not creating a valid template with Python
On https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-python?tabs=linux%2Cbash%2Cazure-cli%2Cbrowser#create-a-local-function it is explained that a new function can be created with the command func new --name HttpExample --template "HTTP trigger" --authlevel "anonymous"
. However, this executing this command generates invalid code. When trying to run func start
afterwards, an exception is raised:
Worker failed to index functions
Result: Failure
Exception: AttributeError: anonymous
It appears that the function decorator is not generated correctly: It should be @app.route(route="HttpExample", auth_level=func.AuthLevel.ANONYMOUS)
instead of @app.route(route="HttpExample", auth_level=func.AuthLevel.Anonymous)
.