We have a Logic app which peeks a message from both queue and topic, handles the message and then complete the message in case all actions are a success or dead letter the message if an error occurred. To organize our dead letter queue, we want to associate a reason to indicate what error occurred. However the out of the box service bus connector does not seem to have an option to set the dead letter reason.
Does anyone know if it is possible to set the dead letter reason from a Logic App? If yes, please share how this can be done.
On trying to use an Azure function, I went stuck how to pass the BrokeredMessage instance from the logic app to the Azure function. When trying to call I get the options below.


