I have azure function app which trigger based on new message into service bus topic.
But if any exception occurs i want to send message into dead letter topic how to do that?
[FunctionName("ProcessData")] public static void Run([ServiceBusTrigger("topic", "sub1", Connection = "ConnectionStringSettingName")]string mySbMsg, TraceWriter log) { try { //process message mySbMsg DataSchema data = JsonConvert.DeserializeObject<DataSchema>(mySbMsg); ... } catch(Exception ex) {
sendErrorEmail();
// How to send message into Dead letter explicitly ? } }
SE