Skip to content

[Microsoft.Azure.WebJobs.Extensions.ServiceBus] Status not set correctly #49867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RohitRanjanMS opened this issue May 7, 2025 · 1 comment
Closed
Labels
needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team.

Comments

@RohitRanjanMS
Copy link
Member

RohitRanjanMS commented May 7, 2025

I have an Azure Functions Service Bus trigger throwing an unhandled exception in the code, I was hoping to see a failure, but the request telemetry still shows success=True. Also, it seems like resultCode only applies to HTTP triggers, as it always shows 0 for Service Bus.

In contrast, HttpTrigger correctly sets success:False when an unhandled error occurs and has the right resultCode.

[Function(nameof(SB))]
public async Task Run(
[ServiceBusTrigger("queue", Connection = "ServiceBusConnection")]ServiceBusReceivedMessage message, ServiceBusMessageActions messageActions)
{
_logger.LogInformation("Message ID: {id}", message.MessageId);
// Complete the message
await messageActions.CompleteMessageAsync(message);
//throw new ArgumentNullException("This is a test exception");
}

Image

It is same with EventHub as well,

Image
@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label May 7, 2025
@jsquire
Copy link
Member

jsquire commented May 7, 2025

The extensions package has no insight nor influence over whether the Functions runtime considers an execution successful or not, it just invokes an executor from the host and observes the outcome. As such, this is something which requires investigation by the Functions host. I've transferred this to the repository where the host is maintained as #11056.

@jsquire jsquire closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team.
Projects
None yet
Development

No branches or pull requests

2 participants