Search code examples
azureexceptionazure-logic-appsazure-iot-suite

How can I handle exception in Azure Logic App


I'm using Azure Logic App. This is the architecture:

Insert Row

I have a Scope Insert Row that include an insert statement in database. I would like to send via mail the message of the exception of the insertion. For example if the Insert statement failed with Foreign key exception, i would like to send this message.

How can I refer to this error message inside the 'Send error Msg' feature?

Thanks a lot guys :)


Solution

  • You could set the Configure run after value to implement it. Set the Send an email action run after Insert row has failed.

    enter image description here

    enter image description here

    If the Insert action success, the send mail won't execute and if it fails the send mail would work. You could also add the run after action value like the time out or is skipped, they are all kind of exceptions.

    enter image description here

    enter image description here

    UPDATE: If this is your error message, you could add it with @{body('Insert_row')?['message']} in code view mode.

    And here is my error message and the subject setting.

    enter image description here

    enter image description here

    enter image description here

    enter image description here