Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The Azure Functions CLI is the next major version (v5) of the local development runtime and tooling for Azure Functions. This version of func.exe features a workload-based architecture, so you only download what you need for the stack you develop on.
Important
The Azure Functions CLI (v5) is currently in preview. This preview version doesn't yet support Java and PowerShell. To work with currently unsupported languages, continue to use Azure Functions Core Tools v4.
There are two versions of func.exe used for local Azure Functions development:
| v4 | v5 | |
|---|---|---|
| API name | Azure Functions Core Tools | Azure Functions CLI |
| Support level | General availability (GA) | Preview |
| Install footprint | Full binary that includes all commands and capabilities for all native languages. | Small base install, plus workloads per-language and other features you add as needed. The host ships as its own workload, so you get the latest host version without re-downloading the CLI. |
| Use when... | You need full GA support for all development workflows. | You want a lightweight, workload-based experience with new features like quickstart templates and profiles that keep your local environment in sync with your Azure hosting plan configuration. |
For the command reference, see Azure Functions CLI reference.
Examples are currently unavailable due to lack of language stack support.
Install the Azure Functions CLI
The Azure Functions CLI is distributed as a small base install plus workloads that you add for the stacks you develop in. Microsoft publishes installer packages for Windows, macOS, and Linux. After installation, the func binary is on your PATH.
Note
While the Azure Functions CLI is in preview, install the latest preview build from the Azure Functions Core Tools releases page. Final installation guidance is published with the general availability release.
Verify the install:
func --version
After you install the base CLI, install the workloads for your stack. The fastest way is func setup, which installs the host, the language worker, the extension bundles (when needed), the stack workload, and the templates workload in one step.
For example:
func setup --features dotnet
func setup --features node
func setup --features python
func setup --features go
You can also install workloads individually by using func workload install. Either way, the first time you run func init, func new, or func run without the necessary workloads installed, the CLI prompts you to install them.
Workloads
The Azure Functions CLI uses a workload model. The base func install is small and language-agnostic. You install workloads on demand to get stack-specific tooling, the Functions host, language workers, extension bundles, and templates.
Workloads fall into these categories:
- Host: The Azure Functions host runtime that
func runuses. - Bundles: Prebuilt extension bundle artifacts so triggers and bindings work out of the box (required for non-.NET stacks).
- Stack: Language-specific project tooling (for example,
python,node,dotnet). - Worker: The language worker the host uses at run time (for example,
python-worker,node-worker). - Templates: Function templates surfaced by
func new(for example,python-templates,node-templates).
For the full list of available workloads and their descriptions, see Available workloads in the CLI reference.
First-run experience
The first time you run func init, func new, or func run, the CLI checks whether the workloads required for your scenario are installed. If they aren't, the CLI prompts you to install them. Accepting the prompt installs the recommended set for the stack you chose. You can decline the prompt and install workloads manually by using func workload install, or run func setup to provision the standard set non-interactively.
Workload updates
Run func workload search periodically to check for newly available workloads. Continue using Core Tools (v4) for unsupported stacks or when you need specific GA features of Core Tools.
Create a local project
To create a new Functions project, use the func init command.
func init MyProjFolder --stack dotnet
func init MyProjFolder --stack node --language javascript
func init MyProjFolder --stack node --language typescript
func init MyProjFolder --stack python
func init MyProjFolder --stack go
The --stack option specifies which language stack to use. The installed workload for that stack provides the scaffolding.
Create a function
To add a function from a template, use the func new command.
func new --template "HTTP trigger" --name MyHttpTrigger
Run functions locally
To start the Functions host and run your project, use func run:
func run
func start is preserved as a backward-compatible alias. The host automatically manages Azurite (local storage emulator) unless you pass --no-azurite.
Scaffold from quickstart templates
To browse and scaffold complete sample apps (HTTP APIs, queue workers, Durable Functions orchestrations), use func quickstart:
func quickstart --stack dotnet --resource http
func quickstart --stack node --resource http
func quickstart --stack python --resource http
func quickstart --stack go --resource http
Manage workloads
Use func workload to install, update, and remove workloads. For the full list of subcommands and options, see func workload in the CLI reference.
Profiles
Profiles encode version constraints for the host, extension bundles, and workers. Apply a profile at runtime by using func run --profile <name>. For the full list of subcommands and options, see func profile in the CLI reference.