-
Notifications
You must be signed in to change notification settings - Fork 439
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
Creating Python HTTP template generates wrong value for --authlevel 'anonymous' #3779
Comments
Tagging @shreyabatra4 to route the issue to the appropriate team. |
Same here @4.0.6280, lost 2h today during a lesson with students. FYI: official docs shows WRONG command https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-python?tabs=linux%2Cbash%2Cazure-cli%2Cbrowser#create-a-local-function |
Same here, lost a couple of hours and figured out by comparing painfully and step by step. |
Created a tiny PR that should fix this, here. Incidentally @aaglietti-itsrizzoli , the lower-case 'anonymous' arg given the documentation should work fine. The user's string isn't passed as a literal, it's first put into an enum |
Version
4.0.5907
Description
Problem
Create a new python function app, and add an http trigger template passing
--authlevel anonymous
or--authlevel ANONYMOUS
.This template generates the incorrect auth_level constant in the decorator:
@app.route(route="MyHttpFunction", auth_level=func.AuthLevel.Anonymous)
It should be upper-case:
@app.route(route="MyHttpFunction", auth_level=func.AuthLevel.ANONYMOUS)
When you run the buggy template, it will give you:
[2024-07-30T13:23:33.803Z] Exception: AttributeError: Anonymous
NOTE
This bug only occurs when passing the parameters explicitly.
If you run it without the flag, i.e.:
func new --template "HTTP trigger" --name MyHttpFunction
It will prompt you:
And the resulting generated template will have the correct constant value.
Steps to reproduce
Code to Execute
Exception Stack Trace
The text was updated successfully, but these errors were encountered: