Welcome to Microsoft Q&A Platform.
Below is an approach I used to get dynamic error messages in mail using Logic App from Azure Data Factory, it worked. If the issue persists, please share your pipeline run id to investigate further.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am facing the below issue with Azure Data Factory using Logic App.
I am using the Azure Data Factory pipeline for migration and Logic App for sending "Success & Failure" notification to the technical team.
Now success is working fine as the message is hardcoded, but failure is not as the Logic App web activity is not able to parse data factory pipeline error.
Here is the input that is going to Logic App web activity
Input
{
"url": "https://xxxxxxxxxxxxxxxxx",
"method": "POST",
"headers": {},
"body": "{\n \"title\": \"PIPELINE RUN FAILED\",\n \"message\":\"Operation on target Migration Validation failed: Execution fail against sql server. Sql error number: 50000. Error Message: The DELETE statement conflicted with the REFERENCE constraint \"FK_cmclientapprovedproducts_cmlinkclientchannel\". The conflict occurred in database \"Core7\", table \"dbo.cmClientApprovedProducts\", column 'linkclientchannelid'.\",\n \"color\": \"Red\",\n \"dataFactoryName\": \"LFC-TO-MCP-ADF\",\n \"pipelineName\": \"LFC TO MCP MIGRATION\",\n \"pipelineRunId\": \"f4f84365-58f0-4da1-aa00-64c3a4daa9e1\",\n \"time\": \"2020-07-31T22:44:01.6477435Z\"\n}"
}
Here is the error logic app is throwing
failures
{
"errorCode": "2108",
"message": "{\"error\":{\"code\":\"InvalidRequestContent\",\"message\":\"The request content is not valid and could not be deserialized: 'After parsing a value an unexpected character was encountered: F. Path 'message', line 3, position 202.'.\"}}",
"failureType": "UserError",
"target": "Send Failed Notification",
"details": []
}
I have tried various options, like set variable and convert by using various existing methods (string, json, replace etc), but no luck
e.g @ hide (activity('LOS migration').Error.Message)
Struggling almost all day this...please suggest if anyone faced a similar issue...
Below is the data flow activity
Welcome to Microsoft Q&A Platform.
Below is an approach I used to get dynamic error messages in mail using Logic App from Azure Data Factory, it worked. If the issue persists, please share your pipeline run id to investigate further.
For those coming here struggling with this terrible problem as I have for way longer than desired; for my case, I have found the solution, and I suspect it will work for many others.
The answer lies in the content of the JSON - if what you are passing in has DOUBLE QUOTES, they need to be replaced with SINGLE quotes. It is the only thing that worked for me.
E.g.:
@string(replace(activity('Execute a failing Pipeline').error.message, '"',''''))
Note that these look identical because the first one is a double quote (what we are replacing) within single quotes, and the second one (what we are replacing it with) is an escaped single quote (i.e. two single quotes in a row) within single quotes.
What a nightmare. But finally got it to work.
This is works fine. Thank you for providing resolution.