Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find Azure Functions when setting up new project in VS 2017

I've recently started to learn Azure Functions. I set up some on the portal, but now I want to develop them in Visual Studio.

I have VS 2017 in version 15.3.2 and I also installed Azure development workload. I've seen on tutorials that I'm supposed to have "Azure Functions" in the Cloud tab when adding new project - but it isn't there. I checked this on my personal and work computer.

I've found "Azure Functions and Web Jobs Tools" add-on on VS Gallery. It adds "Azure Functions" options, but it isn't working as I wished. I don't have dedicated forms for adding new functions and things like that.

Is there any bug in this addon? Do you know if I have to install something more?

like image 316
Paweł Reszka Avatar asked Aug 27 '17 12:08

Paweł Reszka


People also ask

How do I get Azure function in Visual Studio?

From the Visual Studio menu, select File > New > Project. In Create a new project, enter functions in the search box, choose the Azure Functions template, and then select Next. In Configure your new project, enter a Project name for your project, and then select Create.

Where are Azure functions deployed?

The unit of deployment for functions in Azure is the function app. All functions in a function app are deployed at the same time. After you enable continuous deployment, access to function code in the Azure portal is configured as read-only because the source of truth is set to be elsewhere.


2 Answers

After your have created a new Azure Function project in VS2017, it's actually an bare-bone project with host.json and local.settings.json.

To create the Azure Function, follow the steps below:

  1. Right-click on the project and choose Add -> New Item -> Azure Function enter image description here

  2. Choose from one of the Azure Function Templates enter image description here

  3. You should see a Azure Function C# code file created for you. enter image description here

Here's a good guide for getting started with Azure Function project in VS2017 15.3 and above.

https://blogs.msdn.microsoft.com/webdev/2017/05/10/azure-function-tools-for-visual-studio-2017/

like image 147
juvchan Avatar answered Oct 21 '22 14:10

juvchan


The blog post referenced by @juvchan has an answer to this exact question

I installed Visual Studio 2017 15.3 and the Azure development workload, but I don’t see the Azure Functions project type or am receiving an error trying to build or run a function app

While pulled in automatically by the Azure development workload, Azure Function tools are distributed via the Visual Studio gallery which gives us the flexibility to update them as needed to react to changes on the Azure side which don’t always happen on the Visual Studio schedule.

If for some reason the tools don’t get automatically updated from the gallery, in Visual Studio, go to Tools | Extensions and Updates, and look at the “Updates” tab. If it shows an update is available for “Azure Functions and Web Job Tools” manually update them by clicking the “Update” button.

This fixed it for me

like image 34
James Mahoney Avatar answered Oct 21 '22 15:10

James Mahoney