Share via

Azure Synapse: 'triggerBody' is not a recognized function

Victor Seifert 156 Reputation points
2023-04-06T11:09:31.28+00:00

We have a pipeline in Synapse which is triggered by a Storage Event Trigger whenever a new file is created in a specific directory.

We recently get errors when using the function '@triggerBody().fileName' to pass the file name to a pipeline component. The official guides still have references to this function call, can anyone tell me what the problem might be? I am at a loss..

Azure Synapse Analytics
Azure Synapse Analytics

An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.


5 answers

Sort by: Most helpful
  1. Victor Seifert 156 Reputation points
    2023-05-08T09:20:00.7066667+00:00

    I got it working thanks to a support ticket with Microsoft. The issue is that we cannot access the trigger-output from inside the pipeline but need to pass it ahead of time to a parameter.

    Solution: create a parameter in your trigger, e.g. called "file_name" and set it to "triggerBody().fileName" and then reference the parameter in your pipeline (e.g. inside a look-up activity).

    My StorageEventTrigger:

    User's image

    My look-up activity:

    User's image

    Was this answer helpful?

    2 people found this answer helpful.

  2. AnnuKumari-MSFT 34,571 Reputation points Microsoft Employee Moderator
    2023-05-26T05:03:36.35+00:00

    Hi Victor Seifert ,

    Thankyou for sharing the resolution with the community. I understand that the workaround for using 'triggerBody' function is to parameter in the trigger named as "file_name" ,reference the same in the lookup activity and provide "triggerBody().fileName" expression in the trigger for the parameter.

    Requesting you to kindly accept this answer since your issue has been resolved. Accepting answer helps the community to get visibility on the resolution. Thankyou.

    Was this answer helpful?

    0 comments No comments

  3. Victor Seifert 156 Reputation points
    2023-05-08T09:18:39.9033333+00:00

    Duplicated.

    Was this answer helpful?

    0 comments No comments

  4. Purushotham Chanda 6 Reputation points
    2023-04-19T13:37:16.12+00:00

    Any update on this issue, this is preventing us from implementing critical functionality.

    Was this answer helpful?

    0 comments No comments

  5. AnnuKumari-MSFT 34,571 Reputation points Microsoft Employee Moderator
    2023-04-10T05:48:31.5233333+00:00

    Hi Victor Seifert , Thankyou for using Microsoft Q&A platform and thanks for posting your question here. I understand from the query that the pipeline is failing when you use @triggerBody().fileName in Azure Synapse. Kindly let me know if that is not the correct understanding. According to the official documentation: System variables supported by Azure Data Factory and Azure Synapse Analytics @triggerBody().fileName has been deprecated in Synapse. Refer the note section.

    Kindly replace the expression with @trigger().outputs.body.fileName instead of @triggerBody().fileName .

    User's image

    Hope it helps. Kindly accept the answer and mark it as helpful if the above information helps. Thankyou

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.