Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

func new not creating a valid template with Python #1525

Open
lukasmu opened this issue Jul 1, 2024 · 0 comments
Open

func new not creating a valid template with Python #1525

lukasmu opened this issue Jul 1, 2024 · 0 comments
Assignees
Labels

Comments

@lukasmu
Copy link

lukasmu commented Jul 1, 2024

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).

@lukasmu lukasmu added the bug label Jul 1, 2024
@bhagyshricompany bhagyshricompany transferred this issue from Azure/Azure-Functions Jul 2, 2024
@gavin-aguiar gavin-aguiar self-assigned this Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants