This application demonstrates an issue with Azure Function Apps using Service Bus binding, where a request is marked as successful even though it fails with an error.
Before deploying the application, you need to:
- Create a Service Bus namespace.
- Create a Function App.
- Within the Service Bus, create a queue named
servicebussuccessonerror
. - Set the
AzureWebJobsServiceBus
environment variable with the connection string to the Service Bus.
Once everything is configured, send a message to the queue. You will observe that:
- The request is marked as successful in the logs.
- The message is redirected to the Dead Letter Queue (DLQ) due to a failure in the function execution.
The following image shows that the request is incorrectly marked as Success: True
despite the function returning an error:
This image shows that the message is correctly redirected to the DLQ: