Azure Data Factory Issue: How to parametrise a custom activity and link an event-based trigger

Sampat, Varun 236 Reputation points
2021-01-08T23:48:45.183+00:00

Hello,

I am trying to parametrise a custom activity of Azure Data Factory (ADF) so that it can take in inputs from the event based trigger (folder name and file name). I have tried to follow the following demos:

  1. https://learn.microsoft.com/en-us/azure/data-factory/how-to-create-event-trigger
  2. https://learn.microsoft.com/en-us/azure/data-factory/transform-data-using-dotnet-custom-activity

However, in demo 1, the Copy Activity, is very easily parametrised, because there is a dataset linked to it. However, in my case, the Custom Activity is not linked to any dataset and hence when I try to attach the event-based trigger to the pipeline containing (only) the Custom Activity, ADF tells me that the pipeline has no parameters.

I have tried looking for a solution but have ended up being confused more. All I am trying to do is run a Python script through the Custom Activity, and while doing so use the folder name and file name as inputs to the Python script.

Any help will be appreciated!

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,646 questions
{count} votes

Accepted answer
  1. HarithaMaddi-MSFT 10,146 Reputation points
    2021-01-12T07:03:30.793+00:00

    Hi @Sampat, Varun ,

    Thanks for your patience. I discussed with product team and they suggested to use expressions similar to below after declaring pipeline parameters and mapping them to event trigger parameters.

    @concat('python main.py ', pipeline().parameters.filename)  
    

    I tested this approach and it is reading the parameter value appropriately and passing it to python script. Please let us know if this helps in implementing the requirement and let us know for further queries, we will be glad to assist.

    --

    • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification.
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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