I'm using isolated azure function to receive message from the queue. I need to validate received message and if it invalid, send it to the dead-letter queue. The only way how to do it I found is to throw exception and after 10 retries the message will be moved to dead letter queue. Of course it is not good solution. Maybe anyone faced the same task? Thanks!
[Function("Example")]
public async Task ExampleAsync([ServiceBusTrigger("example", Connection = "ServiceBusConnection")] string entityId)
{
if (!int.TryParse(entityId, out var id))
{
// TODO: Move to dead-letter queue
}
}