Azure / Azure/azure-functions-core-tools

Func new --template prompts for template numbers which are not listed

Open
#3,172 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
4d 20h
Merged PRs (30d)
14

Description

core tools version: 4.0.4829 (x64 on rosetta to use python)
OS: MacOs Montery 12.6 (Mac M1 Pro)

If I use `func new` with no arguments there is a nice TUI that has me select the functions templates, and those are numbered.

I tried then the following using the `func templates list` + `func new --template 'Timer trigger'`. I was a bit confused because it prompts for a template number, which func templates list does not show, but then name was filled in. This is just minor confusion because it went on to work. But if I had something invalid I would have been more confused.

I simply suggest a change to the CLI output text to say "Functions template name:" instead of "Select a number of a template:". If template number is a thing we should consider returning a table from list that has both the name and number.

Details:

```console
paulyuk@Pauls-MBP-2  ~/src/functions/templates  func version
4.0.4829
paulyuk@Pauls-MBP-2  ~/src/functions/templates  func init
Found Python version 3.9.6 (python3).
Did you know? There is a new Python programming model in public preview. For fewer files and a decorator based approach, learn how you can try it out today at https://aka.ms/pythonprogrammingmodel
requirements.txt already exists. Skipped!
getting_started.md already exists. Skipped!
.gitignore already exists. Skipped!
host.json already exists. Skipped!
local.settings.json already exists. Skipped!
/Users/paulyuk/src/functions/templates/.vscode/extensions.json already exists. Skipped!
paulyuk@Pauls-MBP-2  ~/src/functions/templates  func templates list
C# Templates:
Azure Blob Storage trigger
Azure Cosmos DB trigger
Durable Functions activity
Durable Functions entity (class)
Durable Functions entity (function)
Durable Functions Entity HTTP starter
Durable Functions HTTP starter
Durable Functions orchestrator
Azure Event Grid trigger
Azure Event Hub trigger
HTTP trigger
IoT Hub (Event Hub)
Kafka output
Kafka trigger
Azure Queue Storage trigger
RabbitMQ trigger
SendGrid
Azure Service Bus Queue trigger
Azure Service Bus Topic trigger
SignalR negotiate HTTP trigger
Timer trigger

Custom Templates:
Azure Blob Storage trigger
Azure Cosmos DB trigger
Azure Event Grid trigger
Azure Event Hub trigger
HTTP trigger
IoT Hub (Event Hub)
Kafka trigger
Azure Queue Storage trigger
RabbitMQ trigger
SendGrid
Azure Service Bus Queue trigger
Azure Service Bus Topic trigger
SignalR negotiate HTTP trigger
Timer trigger

JavaScript Templates:
Azure Blob Storage trigger
Azure Cosmos DB trigger
Durable Functions activity
Durable Functions entity
Durable Functions Entity HTTP starter
Durable Functions HTTP starter
Durable Functions orchestrator
Azure Event Grid trigger
Azure Event Hub trigger
HTTP trigger
IoT Hub (Event Hub)
Kafka output
Kafka trigger
Azure Queue Storage trigger
RabbitMQ trigger
SendGrid
Azure Service Bus Queue trigger
Azure Service Bus Topic trigger
SignalR negotiate HTTP trigger
Timer trigger

PowerShell 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)
Kafka output
Kafka trigger
Azure Queue Storage trigger
RabbitMQ trigger
SendGrid
Azure Service Bus Queue trigger
Azure Service Bus Topic trigger
SignalR negotiate HTTP trigger
Timer trigger

Python Templates:
Azure Blob Storage trigger
Azure Cosmos DB trigger
Durable Functions activity
Durable Functions entity
Durable Functions HTTP starter
Durable Functions orchestrator
Azure Event Grid trigger
Azure Event Hub trigger
HTTP trigger
Kafka output
Kafka trigger
Azure Queue Storage trigger
RabbitMQ trigger
Azure Service Bus Queue trigger
Azure Service Bus Topic trigger
Timer trigger

TypeScript Templates:
Azure Blob Storage trigger
Azure Cosmos DB trigger
Durable Functions activity
Durable Functions entity
Durable Functions Entity HTTP starter
Durable Functions HTTP starter
Durable Functions orchestrator
Azure Event Grid trigger
Azure Event Hub trigger
HTTP trigger
IoT Hub (Event Hub)
Kafka output
Kafka trigger
Azure Queue Storage trigger
RabbitMQ trigger
SendGrid
Azure Service Bus Queue trigger
Azure Service Bus Topic trigger
SignalR negotiate HTTP trigger
Timer trigger

paulyuk@Pauls-MBP-2  ~/src/functions/templates  func new --template 'Timer trigger'
**Select a number for template:Timer trigger**
Function name: [TimerTrigger]
```

Contributor guide

Open the contributing guide

Research direction

Start with the `func new --template` CLI flow and compare its prompt with the output from `func templates list`. Verify the prompt uses the template name wording when a name is supplied, and confirm the resulting `func new --template 'Timer trigger'` flow no longer asks for an unexplained number.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.