Register Azure Functions binding extensions

In Azure Functions version 2.x, bindings are available as separate packages from the functions runtime. While .NET functions access bindings through NuGet packages, extension bundles allow other functions access to all bindings through a configuration setting.

Consider the following items related to binding extensions:

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
Non-.NET languages or local Azure Core Tools development Automatic Use Azure Functions Core Tools and extension bundles
C# class library using Visual Studio 2019 Use NuGet tools Use NuGet tools
C# class library using Visual Studio Code N/A Use .NET Core CLI

Local development with Azure Functions Core Tools and extension bundles

Extension bundles make all bindings published by the Azure Functions team available through a setting in the host.json file. For local development, ensure you have the latest version of Azure Functions Core Tools.

To use extension bundles, update the host.json file to include the following entry for extensionBundle:

{
    "version": "2.0",
    "extensionBundle": {
        "id": "Microsoft.Azure.Functions.ExtensionBundle",
        "version": "[1.*, 2.0.0)"
    }
}
  • The id property references the namespace for Microsoft Azure Functions extension bundles.
  • The version references the version of the bundle.

Bundle versions increment as packages in the bundle changes. Major version changes happen only when packages in the bundle move a major version. The version property uses the interval notation for specifying version ranges. The Functions runtime always picks the maximum permissible version defined by the version range or interval.

Once you reference the extension bundles in your project, then all default bindings are available to your functions. The bindings available in the extension bundle are:

Package Version
Microsoft.Azure.WebJobs.Extensions.CosmosDB 3.0.3
Microsoft.Azure.WebJobs.Extensions.DurableTask 1.8.0
Microsoft.Azure.WebJobs.Extensions.EventGrid 2.0.0
Microsoft.Azure.WebJobs.Extensions.EventHubs 3.0.3
Microsoft.Azure.WebJobs.Extensions.SendGrid 3.0.0
Microsoft.Azure.WebJobs.Extensions.ServiceBus 3.0.3
Microsoft.Azure.WebJobs.Extensions.SignalRService 1.0.0
Microsoft.Azure.WebJobs.Extensions.Storage 3.0.4
Microsoft.Azure.WebJobs.Extensions.Twilio 3.0.0

C# class library with Visual Studio 2019

In Visual Studio 2019, 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 used 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