Azure Functions CLI Tooling Errors with latest .NET 6 Preview installed
See original GitHub issueWhen using the Azure Function CLI, unable to create a new C# based Azure Function through func new
functionality.
.NET SDKs installed
C:\Temp\azure-issues> dotnet --list-sdks 2.2.401 [C:\Program Files\dotnet\sdk] 3.1.301 [C:\Program Files\dotnet\sdk] 3.1.406 [C:\Program Files\dotnet\sdk] 5.0.103 [C:\Program Files\dotnet\sdk] 5.0.302 [C:\Program Files\dotnet\sdk] 5.0.400-preview.21328.4 [C:\Program Files\dotnet\sdk] 6.0.100-preview.6.21355.2 [C:\Program Files\dotnet\sdk] C:\Temp\azure-issues>
Azure Functions Core Tools installed
C:\Temp\azure-issues> func
%%%%%%
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%
Azure Functions Core Tools Core Tools Version: 3.0.3568 Commit hash: e30a0ede85fd498199c28ad699ab2548593f759b (64-bit) Function Runtime Version: 3.0.15828.0
Steps to reproduce
- create directory
- do into directory
func init
to create C# function appfunc new
to create C# Http Trigger function- Select HttpTrigger and name the function
Expected results
New function is created
Actual results
Template error.
C:\Temp\azure-issues> func new Use the up/down arrow keys to select a template:Function name: TestForIssue TestForIssue 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
Work Around
Add in global json file
More info - https://adamstorr.azurewebsites.net/blog/azure-functions-cli-failing-after-preview-install
Logged under guidance from Anthony Chu - https://twitter.com/nthonyChu/status/1422565903284129793
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top GitHub Comments
To link things together – this was fixed in https://github.com/Azure/azure-functions-core-tools/pull/2693. Root cause was https://github.com/dotnet/templating/issues/3779 and we had to switch to using shortnames for templates internally.
A new version of Core Tools V4 with a fix has been published. This is currently available on npm:
npm install -g azure-functions-core-tools@4
.