Create a local Functions project

Create a local Functions project directory which equivalent to a function app in Azure

Akhitha Babu
Nerd For Tech
4 min readMar 9, 2021

--

Photo by Daniel Mingook Kim on Unsplash

A Functions project directory contains the files host.json and local.settings.json, along with subfolders that contain the code for individual functions. This directory is the equivalent of a function app in Azure.

Version 3.x/2.x requires you to select a default language for your project when it is initialized. In version 3.x/2.x, all functions added use default language templates. In version 1.x, you specify the language each time you create a function.

How to create a project?

In the terminal window or from a command prompt, run the following command to create the project and local Git repository:

func init MyFunctionProj

Note: Java uses a Maven archetype to create the local Functions project, along with your first HTTP triggered function. Use the following command to create your Java project: mvn archetype:generate -DarchetypeGroupId=com.microsoft.azure -DarchetypeArtifactId=azure-functions-archetype. For an example using the Maven archetype, see the Command line quickstart.

When you provide a project name, a new folder with that name is created and initialized. Otherwise, the current folder is initialized.
In version 3.x/2.x, when you run the command you must choose a runtime for your project.

Use the up/down arrow keys to choose a language, then press Enter.

Note: If you plan to develop JavaScript or TypeScript functions, choose node, and then select the language. TypeScript has some additional requirements.

Here we are using python. Use the down arrow keys to choose the language python.

Then press Enter.

The output looks like the following example for a Python project:

func init supports the following options, which are version 3.x/2.x-only, unless otherwise noted:

from the link

Note: By default, version 2.x and later versions of the Core Tools create function app projects for the .NET runtime as C# class projects (.csproj). These C# projects, which can be used with Visual Studio or Visual Studio Code, are compiled during testing and when publishing to Azure. If you instead want to create and work with the same C# script (.csx) files created in version 1.x and in the portal, you must include the --csx parameter when you create and deploy functions.

--

--