Patterson
Patterson

Reputation: 2823

Azure Data Factory Error: 'activity' is not a recognized function

I am trying to adding the following to the directory in Azure Data Factory

sales/@{activity('Lookup Old Watermark').output.firstRow.table_name}/@{formatDateTime(utcnow(),'yyyy')}/@{formatDateTime(utcnow(),'MM')}/@{formatDateTime(utcnow(),'dd')}/@{formatDateTime(utcnow(),'HH')}

But I'm getting the error:

'activity' is not a recognized function

See this screenshot:

enter image description here

Any thoughts?

I should mention, I'm following the steps listed in the image below: enter image description here

Upvotes: 0

Views: 486

Answers (1)

Vamsi Bitra
Vamsi Bitra

Reputation: 2762

I tried to reproduce the same in my environment and got same error:

Re1

The reason for the error is: @activity is recognized only inside the pipeline, but not dataset

To resolve this error, we need to pass the dynamic content to dataset parameter. Try using the following approach

Step 1: Open dataset and go to parameter section, create parameter. Ref1

Ref3

Ref4

Step 2: Go to connection section and add dynamic content sales/@{dataset().directort}.

Ref5

Step 3: After that, Go to Sink add dynamic content.

In my scenario this my dynamic content: sales/@{activity('Lookup1').output.firstRow.Prop_0}/@{formatDateTime(utcnow(),'yyyy')}/@{formatDateTime(utcnow(),'MM')}/@{formatDateTime(utcnow(),'dd')}/@{formatDateTime(utcnow(),'HH')}

Ref6

Output:

Ref8

Upvotes: 1

Related Questions