8
votes

I am using Visual Studio 2017 preview(2) to create Azure Function. The template generated for it is very different from what I get in Visual Studio 2015.

The Visual Studio 2017 template create a .cs file for function, and template structure looks like below :

Visual Studio 2017 Azure Function Template Structure

All functions are created as individual .cs file and there are no run.csx, project.json or function.json files, due to which I am not able to specify function specific dependencies and settings

If we see the earlier template (see the image below) with Visual Studio 2015, it well represent the folders and files available on Azure Portal. It has functions in individual folder with all .json and .csx file. This folder structure helps in segregating files related to a particular function (which is not the case with VS 2017 template)

Visual Studio 2015 Azure Function Template Structure

In VS 2017, I want to specify function specific dependencies and binding settings by adding project.json and function.json. Please let me know about the way to achieve this?

1

1 Answers

10
votes

This is intended. Azure Functions team changed the way you develop and deploy Function Apps in Visual Studio 2017. Now, it's basically a compiled class library, with functions being static methods with proper attributes.

You should not be editing function.json manually anymore; instead use WebJob SDK attributes. Packages management is done the normal .NET way via NuGet packages.

The "old way" still works from within Azure portal for quick prototyping and experiments, but Visual Studio won't support it anymore.