Azure / azure-functions-python-worker

Python worker for Azure Functions.
http://aka.ms/azurefunctions
MIT License
331 stars 100 forks source link

Naming for templates is different for python V1 and V2 functions #1427

Open hallvictoria opened 7 months ago

hallvictoria commented 7 months ago

For multiple templates, the template names are different between V1 and V2 apps. For example, for V1 apps, running func new --template "Azure Event Hub Trigger" --name myFunction works successfully. However, for V2, running the same command throws this error:

Screenshot 2023-11-21 163803

For V2 apps, the EventHub Trigger is supported and can be created by calling func new --template "EventHub trigger" --name myFunction instead.

Screenshot 2023-11-21 163934

Can the template names be consistent with both V1 and V2 apps so that func new --template "Azure Event Hub Trigger" --name myFunction works for V2 functions as well?

Steps to reproduce:

  1. Install Core Tools v4.0.5455
  2. Run func init az-functions
  3. Run func new --template "Azure Event Hub trigger" --name myFunction -- this does not work and throws the Object reference not set to an instance of an object. error
  4. Run func new --template "EventHub trigger" --name myFunction -- this works.

Expected Behaviour: The EventHub trigger is created when the template name is "Azure Event Hub trigger"

Actual Behaviour: Object reference not set to an instance of an object error is returned.