Azure Functions (in-process) for Service Bus Upgrade Version 2 to 3

Update to Microsoft.Azure.WebJobs.Extensions.ServiceBus SDK version 5

The dependency on Microsoft.Azure.WebJobs.Extensions.ServiceBus has been updated which means that the new Azure.Messaging.ServiceBus SDK is being used by the function host to receive messages. If the solution contains code that directly accesses native SDK types, read the Microsoft Migration Guide.

Microsoft.Azure.WebJobs.Extensions.ServiceBus Version 5 requires EnableCrossEntityTransactions to be enabled in order to support sends atomic with receive.

This can be done by adding the following to host.json:

"extensions": {
    "ServiceBus": {
      "EnableCrossEntityTransactions": true

Manually invoking process message

In version 2 of the Azure Functions package, IFunctionEndpoint exposes two different Process methods where the one accepting a IMessageReceiver is the one that processed the message in "atomic sends with receive" mode.

Version 3 exposes different methods for the two different use cases.


Task ProcessAtomic(ServiceBusReceivedMessage message, ExecutionContext executionContext, ServiceBusClient serviceBusClient, ServiceBusMessageActions messageActions, ILogger functionsLogger = null);

to process the message with "atomic sends with receive" transaction mode.


Task ProcessNonAtomic(ServiceBusReceivedMessage message, ExecutionContext executionContext, ILogger functionsLogger = null);

to process the message in "receive only" transaction mode.

Injecting FunctionEndpoint

FunctionEndpoint can no longer be injected, use IFunctionEndpoint instead.

Related Articles

Last modified