-
Notifications
You must be signed in to change notification settings - Fork 441
Binding Extensions Management
In the 2.0 version of the Azure Functions runtime, a new binding extensibility model is being introduced, and with the exception of a few core bindings (e.g. HTTP, Timer), all bindings have been migrated to take advantage of this new model and are no longer referenced by the runtime by default.
This new model further decouples the runtime from the extensions, providing additional flexibility, while minimizing the load by only loading extensions used by the Function App, but it does mean that, out of the box, the runtime has no knowledge of those extensions and they must be registered before use.
Extensions are distributed as NuGet packages hosted on the public NuGet feed at nuget.org. Installation and registration are performed using those packages.
By the time the new version of the runtime is released, this process will be seamless. Templates and extensions referenced using Visual Studio will automatically perform the extension registration, but today, manual steps are required depending on the flow and tooling you are using.
The CLI has been enhanced to handle extension installation. A new extensions context has been added with commands to allow you to perform extension management:
func extensions install Performs extension installation and registration func extensions sync This command performs the installation and registration of referenced extensions, also removing any extensions no longer referenced.
The following example shows the command you must run in order to install and use the CosmosDB extension:
func extensions install --package Microsoft.Azure.WebJobs.Extensions.CosmosDB --version 3.0.0-beta6
When using Visual Studio, you'll be referencing the extension packages directly from your project in order to use their attributes and other types, so Visual Studio handles the installation process, but registration still needs to be performed. This is handled by a custom build task, added by the Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator NuGet package, which must be explicitly referenced (this will be automatically brought in by the SDK/Visual Studio tools in a future update).
These are the steps you must follow to use the CosmosDB extension mentioned in our previous example:
- Add a reference to the Microsoft.Azure.WebJobs.Extensions.CosmosDB NuGet package
- Add a reference to the Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator
- Build the project
Any of the installation approaches described above will generate a metadata file named extensions.json in a bin folder inside of your Function App root, alongside with all the binaries and other files brought in by the extension itself. Only extensions registered in this file will be used by the runtime.
- Configuration Settings
- function.json
- host.json
- host.json (v2)
- Http Functions
- Function Runtime Versioning
- Official Functions developers guide
- Host Health Monitor
- Managing Connections
- Renaming a Function
- Retrieving information about the currently running function
- Site Extension Resolution
- Linux Consumption Regions
- Using LinuxFxVersion for Linux Function apps
- Out-of-proc Cancellation Tokens
- Assembly Resolution in Azure Functions
- ILogger
- Precompiled functions
- Official Functions C# developer reference
- Contributor Onboarding
- Development Process
- Deploying the Functions runtime as a private site extension
- Authoring & Testing Language Extensions
- Bindings in out-of-proc
- Language Extensibility
- Worker Capabilities
- Investigating and reporting issues with timer triggered functions not firing
- Sharing Your Function App name privately
- Azure Functions CLI release notes [moved here]
- Function App Zipped Deployment [deprecated]