question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Azure Functions CLI Tooling Errors with latest .NET 6 Preview installed

See original GitHub issue

When 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

  1. create directory
  2. do into directory
  3. func init to create C# function app
  4. func new to create C# Http Trigger function
  5. 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:closed
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
brettsamcommented, Sep 13, 2021

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.

2reactions
anthonychucommented, Sep 13, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Functions CLI Failing After Preview Install - Adam Storr
Getting an error on the command line when using the Azure Functions tools to create new C# functions. Let's see how to get...
Read more >
Work with Azure Functions Core Tools
Learn how to code and test Azure Functions from the command prompt or terminal on your local computer before you run them on...
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
Troubleshoot .NET tool usage issues
A common reason for failure is that the tool name isn't correct. This can happen because of mistyping, or because the tool has...
Read more >
Azure Functions runtime versions overview
Azure Functions supports multiple versions of the runtime. Learn the differences between them and how to choose the one that's right for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found