Edit

Share via


Azure DocumentDB bindings for Azure Functions

Important

The Azure DocumentDB extension is currently in preview. At this time, only .NET apps that use the legacy in-process model are supported.

The Azure DocumentDB bindings for Azure Functions enable you to integrate your serverless applications with Azure DocumentDB collections. The Azure DocumentDB extension supports trigger, input, and output bindings for Azure DocumentDB.

Using the Azure DocumentDB extension, you can build functions that can:

Action Trigger/binding type
Execute on changes to a collection Azure DocumentDB trigger
Write documents to the database Azure DocumentDB output binding
Query the database Azure DocumentDB input binding

Here are things you should consider when using the Azure DocumentDB extension:

  • Only .NET/C# apps that use the legacy in-process model are currently supported in preview.

  • The Azure DocumentDB binding extension doesn't currently support Microsoft Entra ID authentication and managed identities.

  • Your app must be using version 4.x of the Azure Functions runtime.

Install the extension

Add the extension to your .NET project for an in-process app by installing the Microsoft.Azure.WebJobs.Extensions.AzureCosmosDb.Mongo preview NuGet package.

Important

While this extension has AzureCosmosDb in the name, the specified extension is the correct one for integrating with Azure DocumentDB.

Warning

Don't try to install this package in a .NET isolated worker process app. Errors occur and the app project can't build. To learn how to create a .NET app that uses the legacy in-process model, see Develop legacy C# class library functions using Azure Functions.