Skip to content

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

Closed as not planned
@RohitRanjanMS

Description

@RohitRanjanMS

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions