Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 Azure Function Template does not have files like - run.csx or project.json

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?

like image 999
Ramkumar Singh Avatar asked May 26 '17 19:05

Ramkumar Singh


People also ask

How to install Azure function in Visual Studio 2017?

Add Azure Function ProjectOpen the Visual Studio and create a new project. Choose “Cloud” from the project template type list and then “Azure Functions” as the project type. Give a meaningful name to your project and click “OK”. To start with, choose Empty as a project type and click “OK” to create the project.

Where is function JSON in Azure function?

json file contains runtime-specific configurations and is in the root folder of the function app.

How to Add local settings json in Azure function?

In the Access keys tab, below Security + networking, copy the Connection string of key1. In your project, open the local. settings. json file and set the value of the AzureWebJobsStorage key to the connection string you copied.


Video Answer


1 Answers

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.

like image 87
Mikhail Shilkov Avatar answered Oct 22 '22 01:10

Mikhail Shilkov