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

Command func templates list returns invalid templates #2955

Open
alfechner opened this issue Feb 15, 2022 · 9 comments
Open

Command func templates list returns invalid templates #2955

alfechner opened this issue Feb 15, 2022 · 9 comments

Comments

@alfechner
Copy link

The templates returned from func templates list are not valid as input for func new's --template parameter.

func templates list --language dotnet returns (amongst others) the template 'Azure Service Bus Topic trigger'.

Using the output in func new --template 'Azure Service Bus Topic trigger' will result in an error Unknown template 'AzureServiceBusTopictrigger' (Parameter 'templateName').

Instead Service Bus Topic trigger needs to be used.

Version 4.0.3971

@alfechner
Copy link
Author

Seems like the once for python functions work as expected.

@Jawz84
Copy link

Jawz84 commented Jul 19, 2022

The same problem occurs for the Durable functions Orchestrator template:

~\GitNoOneDrive\test> func templates list --language c# | sls orchestrator

  Durable Functions orchestrator

~\GitNoOneDrive\test> func new --template 'Durable Functions orchestrator' --name foo --language c# --worker-runtime dotnet
Use the up/down arrow keys to select a template:Function name: foo
Unknown template 'DurableFunctionsorchestrator' (Parameter 'templateName')

The correct template name turned out to be 'DurableFunctionsorchestration'.

@antoninod
Copy link

Still having this problem with Function Runtime Version: 4.11.2.19273

I found the correct template name at :

@m-ali-zafar
Copy link

m-ali-zafar commented Oct 24, 2022

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

image

@mcollier
Copy link

The list of templates returned by func templates list --language C# does not match the template list shown after executing func new --language C#. Why would these lists be different?

> func new --language C#
Select a number for template:
1. QueueTrigger
2. HttpTrigger
3. BlobTrigger
4. TimerTrigger
5. KafkaTrigger
6. KafkaOutput
7. DurableFunctionsOrchestration
8. SendGrid
9. EventHubTrigger
10. ServiceBusQueueTrigger
11. ServiceBusTopicTrigger
12. EventGridTrigger
13. CosmosDBTrigger
14. IotHubTrigger
Choose option: 
> func templates list --language C#
C# Templates:
  Azure Blob Storage trigger
  Azure Cosmos DB trigger
  Durable Functions activity
  Durable Functions HTTP starter
  Durable Functions orchestrator
  Azure Event Grid trigger
  Azure Event Hub trigger
  HTTP trigger
  IoT Hub (Event Hub)
  Azure Queue Storage trigger
  RabbitMQ trigger
  SendGrid
  Azure Service Bus Queue trigger
  Azure Service Bus Topic trigger
  SignalR negotiate HTTP trigger
  Timer trigger

@erjosito
Copy link

Great stuff @mcollier you saved my day.

@AntonKomir
Copy link

The same problem with Azure Service Bus Queue trigger, which is presented in "func templates list"

Result

func init FunctionApp --worker-runtime dotnet-isolated

Writing D:\FunctionApp.vscode\extensions.json

func new --template "Azure Service Bus Queue trigger" --name FunctionApp
Template: Azure Service Bus Queue trigger
Function name: FunctionApp

Creating dotnet function...
Unknown template 'AzureServiceBusQueuetrigger' (Parameter 'templateName')

@AntonKomir
Copy link

@mcollier Thanks, your tip saved a lot of time.

@daveferrara1
Copy link

daveferrara1 commented Aug 20, 2024

Posting along for someone else new to Azure functions like me. I was able to pass the C# value posted from the list above by @mcollier .

The tutorial command doesn't work like reported above. Microsoft tutorial: : https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=macos%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&pivots=programming-language-csharp

That tutorial provides func new --template "Azure Queue Storage Trigger" --name MyQueueTrigger but that doesn't work. Using: func new --template QueueTrigger does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants