When using an Azure Function with a Service Bus trigger in .NET 8 isolated mode and with session-enabled batching, the ServiceBusSessionMessageActions parameter is unexpectedly null.
When batching is enabled (IsBatched = true) and sessions are also enabled, the serviceBusSessionMessageActions parameter is always null.
However, when batching is disabled (IsBatched = false), the serviceBusSessionMessageActions is properly injected and can be used as expected.
Expected Behavior:
ServiceBusSessionMessageActions should be injected properly even when batching is enabled, allowing session-related actions (e.g., session state management) to be handled within the function.
Actual Behavior:
When IsBatched = true, the serviceBusSessionMessageActions parameter is always null, making it impossible to perform session-related actions in a batched function.
Steps to Reproduce:
Create an Azure Function in .NET 8 isolated mode.
Use a ServiceBusTrigger with the following conditions:
Sessions enabled (IsSessionsEnabled = true).
Batching enabled (IsBatched = true).
Add ServiceBusSessionMessageActions serviceBusSessionMessageActions as a parameter in the function signature.
Trigger the function with session-enabled messages in the Service Bus.
Observe that serviceBusSessionMessageActions is null when the function is invoked.
Description
When using an Azure Function with a Service Bus trigger in .NET 8 isolated mode and with session-enabled batching, the ServiceBusSessionMessageActions parameter is unexpectedly null.
Example:
Issue:
Expected Behavior:
ServiceBusSessionMessageActions should be injected properly even when batching is enabled, allowing session-related actions (e.g., session state management) to be handled within the function.
Actual Behavior:
When IsBatched = true, the serviceBusSessionMessageActions parameter is always null, making it impossible to perform session-related actions in a batched function.
Steps to Reproduce: