Open gabesmsft opened 3 years ago
I have this problem with a new install (no prior Functions runtime v3 or otherwise install).
> dotnet new HttpTrigger --search
These templates matched your input: 'HttpTrigger'
Template Name Short Name Author Language Package Downloads
---------------------- ----------- --------- -------- ---------------------------------------------- ---------
HttpTrigger http Microsoft [C#],F# Microsoft.Azure.WebJobs.ItemTemplates 4,518k
HttpTrigger http Microsoft [C#] Microsoft.Azure.Functions.Worker.ItemTemplates 178k
HttpTriggerWithOpenAPI httpOpenAPI Microsoft [C#] Microsoft.Azure.WebJobs.ItemTemplates 4,518k
I install using the Microsoft.Azure.WebJobs.ItemTemplates
PS C:\Users\m\repos\FunkySix> dotnet new --install Microsoft.Azure.WebJobs.ItemTemplates
The following template packages will be installed:
Microsoft.Azure.WebJobs.ItemTemplates
Success: Microsoft.Azure.WebJobs.ItemTemplates::3.1.1812 installed the following templates:
Template Name Short Name Language Tags
----------------------------- --------------- -------- ----------------------------------------------
BlobTrigger blob [C#],F# Azure Function/Trigger/Blob
CosmosDBTrigger cosmos,CosmosDB [C#],F# Azure Function/Trigger/Cosmos DB
DurableFunctionsOrchestration durable [C#] Azure Function/Durable Functions Orchestration
EventGridTrigger eventgrid [C#] Azure Function/Trigger/EventGrid
EventHubTrigger eventhub [C#],F# Azure Function/Trigger/EventHub
HttpTrigger http [C#],F# Azure Function/Trigger/Http
HttpTriggerWithOpenAPI httpOpenAPI [C#] Azure Function/Trigger/Http
IotHubTrigger iothub [C#] Azure Function/Trigger/IotHub
KafkaOutput kafkao [C#] Azure Function/Ouput/Kafka
KafkaTrigger kafka [C#] Azure Function/Trigger/Kafka
QueueTrigger queue [C#] Azure Function/Trigger/Storage Queue
RabbitMQTrigger rqueue [C#] Azure Function/Trigger/RabbitMQ Queue
SendGrid sendgrid [C#] Azure Function/Ouput/SendGrid
ServiceBusQueueTrigger squeue [C#] Azure Function/Trigger/Service Bus/Queue
ServiceBusTopicTrigger stopic [C#] Azure Function/Trigger/Service Bus/Topic
SignalRTrigger signalr [C#] Azure Function/Trigger/Http/SignalR
TimerTrigger timer [C#],F# Azure Function/Trigger/Timer
And when I do a dotnet new --list, it shows up
PS C:\Users\m\repos\FunkySix> dotnet new --install Microsoft.Azure.WebJobs.ItemTemplates
The following template packages will be installed:
Microsoft.Azure.WebJobs.ItemTemplates
Success: Microsoft.Azure.WebJobs.ItemTemplates::3.1.1812 installed the following templates:
Template Name Short Name Language Tags
----------------------------- --------------- -------- ----------------------------------------------
BlobTrigger blob [C#],F# Azure Function/Trigger/Blob
CosmosDBTrigger cosmos,CosmosDB [C#],F# Azure Function/Trigger/Cosmos DB
DurableFunctionsOrchestration durable [C#] Azure Function/Durable Functions Orchestration
EventGridTrigger eventgrid [C#] Azure Function/Trigger/EventGrid
EventHubTrigger eventhub [C#],F# Azure Function/Trigger/EventHub
HttpTrigger http [C#],F# Azure Function/Trigger/Http
HttpTriggerWithOpenAPI httpOpenAPI [C#] Azure Function/Trigger/Http
IotHubTrigger iothub [C#] Azure Function/Trigger/IotHub
KafkaOutput kafkao [C#] Azure Function/Ouput/Kafka
KafkaTrigger kafka [C#] Azure Function/Trigger/Kafka
QueueTrigger queue [C#] Azure Function/Trigger/Storage Queue
RabbitMQTrigger rqueue [C#] Azure Function/Trigger/RabbitMQ Queue
SendGrid sendgrid [C#] Azure Function/Ouput/SendGrid
ServiceBusQueueTrigger squeue [C#] Azure Function/Trigger/Service Bus/Queue
ServiceBusTopicTrigger stopic [C#] Azure Function/Trigger/Service Bus/Topic
SignalRTrigger signalr [C#] Azure Function/Trigger/Http/SignalR
TimerTrigger timer [C#],F# Azure Function/Trigger/Timer
However the func new still fails, and then with I do the above command the HttpTrigger no longer shows up
Probably makes sense to link it to this issue 1076 in Azure/azure-function-templates Azure/Azure-Functions#1076
If I install the Functions v4 runtime and .NET 6 preview on a machine that previously had an earlier Functions Core Tools install (eg v3), I get the following error when I try to add a Function to the project. No templates found matching: 'HTTPtrigger'. To list installed templates, run 'dotnet new --list'. To search for the templates on NuGet.org, run 'dotnet new HTTPtrigger --search'.
Error creating function
Note: I get a comparable error regardless of what type of Function I try to add (eg QueueTrigger, etc).
My environment: OS: Windows (eg Windows 10 or Windows Server 2019) Core Tools Version: 4.0.3687 Commit hash: 9974228c80b20f3128903fac1035d94200d0ba5f (64-bit) .NET SDKs: 3.1.302.15188 5.1.120.60105 6.1.21.35502
Node.js: 14.7.0 Visual Studio 2019
Repro steps:
Expected result: Function would get created. Actual result: above-mentioned error.
Same result if I run func new and then select HttpTrigger or another Function type in the list.
If I uninstall .NET 6 SDK, I can create Functions in the project. Once I have Function, I can use the above setup (with .NET 6 SDK installed) to build and run the project and execute the function.