Search code examples
c#azure.net-coreazure-functionsazureservicebus

Service Bus Trigger Azure Function in .Net 7 Isolated Process - Handling Deadletter Queue


I am working with Service Bus Queue Trigger Azure Function in .Net 7 Isolated Process as below

[Function(nameof(MyFunction))]
        public async Task Run([ServiceBusTrigger("%MyTopic%-%MySubscription%", Connection = ServiceBusConnectionName)] string receivedMessage, FunctionContext context)
        {
            _logger.LogInformation("Processing begins");
        }

I would like to send the message to Deadletter Queue when certain condition is met. However I am not able to do that with the above setup. I need to have the ServiceBusReceiver as part of the Function argument to manually send the messages to Deadletter Queue. It looks like the Isolated Process doesnt support ServiceBusReceiver as an argument. Ideally what I would like to achieve is as below in .Net 7 isolated process.

Is this possible in isolated process?

-Alan-

[Function(nameof(MyFunction))]
        public async Task Run([ServiceBusTrigger("%MyTopic%-%MySubscription%", Connection = ServiceBusConnectionName)] ServiceBusReceivedMessage receivedMessage, ServiceBusReceiver messageReceiver)
        {
            _logger.LogInformation("Processing begins");
        }

Solution

  • This is not possible today but will be once the work on message dispositioning will be completed.