Register Azure Functions binding extensions

Azure Functions supports HTTP and timer out of the box. To work with other services, you need to install or register a binding extension. Binding extensions are provided via Azure Core Tools or NuGet packages.

The following table indicates when and how you register bindings.

Development environment Registration
in Functions 1.x
Registration
in Functions 2.x
Azure portal Automatic Automatic with prompt
Non-.NET languages or local Azure Core Tools development Automatic Use Core Tools CLI commands
C# class library using Visual Studio 2017 Use NuGet tools Use NuGet tools
C# class library using Visual Studio Code N/A Use .NET Core CLI

The following binding types are exceptions that don't require explicit registration because they are automatically registered in all versions and environments: HTTP and timer.

Important

This content for the rest of this article applies only to Functions 2.x. Binding extensions aren't explicitly registered in Functions 1.x except when creating a C# class library using Visual Studio 2017.

Azure portal development

When you create a function or add a binding, you are prompted when the extension for the trigger or binding requires registration. Respond to the prompt by clicking Install to register the extension. Installation can take up to 10 minutes on a consumption plan.

You need only install each extension one time for a given function app. For supported bindings that are not available in the portal or to update the an installed extension, you can also manually install or update Azure Functions binding extensions from the portal.

Local development Azure Functions Core Tools

When you develop functions locally, you can install the extensions you need by using the Azure Functions Core Tools from the Terminal or from a command prompt.

After you have updated your function.json file to include all the bindings that your function needs, run the following command in the project folder.

func extensions install

The command reads the function.json file to see which packages you need, installs them, and rebuilds the extensions project. It adds any new bindings at the current version but does not update existing bindings. Use the --force option to update existing bindings to the latest version when installing new ones.

If you want to install a particular version of a package or you want to install packages before editing the function.json file, use the func extensions install command with the name of the package, as shown in the following example:

func extensions install --package Microsoft.Azure.WebJobs.ServiceBus --version <target_version>

Replace <target_version> with a specific version of the package, such as 3.0.0-beta5. Valid versions are listed on the individual package pages at NuGet.org.

C# class library with Visual Studio 2017

In Visual Studio 2017, you can install packages from the Package Manager Console using the Install-Package command, as shown in the following example:

Install-Package Microsoft.Azure.WebJobs.Extensions.ServiceBus -Version <target_version>

The name of the package to use for a given binding is provided in the reference article for that binding. For an example, see the Packages section of the Service Bus binding reference article.

Replace <target_version> in the example with a specific version of the package, such as 3.0.0-beta5. Valid versions are listed on the individual package pages at NuGet.org. The major versions that correspond to Functions runtime 1.x or 2.x are specified in the reference article for the binding.

C# class library with Visual Studio Code

In Visual Studio Code, you can install packages from the command prompt using the dotnet add package command in the .NET Core CLI, as shown in the following example:

dotnet add package Microsoft.Azure.WebJobs.Extensions.ServiceBus --version <target_version>

The .NET Core CLI can only be used for Azure Functions 2.x development.

The name of the package to use for a given binding is provided in the reference article for that binding. For an example, see the Packages section of the Service Bus binding reference article.

Replace <target_version> in the example with a specific version of the package, such as 3.0.0-beta5. Valid versions are listed on the individual package pages at NuGet.org. The major versions that correspond to Functions runtime 1.x or 2.x are specified in the reference article for the binding.

Next steps