Matt Owen
Matt Owen

Reputation: 37

Use Parameterised Dataset Filename in Dataflow Sink

I have a dataflow that has a parameterised dataset that I'm using for the Sink activity. In the dataset it has a parameter that I've configured to be used as the filename.

Dataset with the parameter

Parameters on the Dataset in question

In the Dataflow sink activity "Settings" what "File name option" should I be using to call the filename I've specified in the Dataflow settings here:

enter image description here

If I set the "Filename option" to "Output to single file" then leave the field "Output to single file" empty, it fails.

If I set the "Filename option" to "Default" it doesn't work wither.

If I set it to "Output single file" and specify "@dataset().Filename" it doesn't work

Even the "$OutFileName" I've tried in the screengrab doesn't work. How can I call the parameter from the dataset?

Sink output settings

Upvotes: 0

Views: 3064

Answers (1)

Vamsi Bitra
Vamsi Bitra

Reputation: 2739

Using the Default Filename Option always generates a sink file with random name by Azure data factory for Dataflows.

  • Instead, you can use Filename Option as Output to Single file and specify the required filename in the pipeline. The following is a demonstration of the same.

  • Create a dataflow parameter named filename of string. Ref1

  • Go to sink settings, for File Name give the value as $filename (open expression builder, select the filename parameter) enter image description here

  • Now publish this dataflow. Create a dataflow pipeline activity and select your dataflow. In the Parameters tab, the dataflow parameter filename appears. Give your desired value.

enter image description here

  • When you run the pipeline, it successfully creates and the file will be created in the desired location. The following is the result of my demonstration.

enter image description here

Upvotes: 0

Related Questions