How to write String Type Variable Value to Text File in Azure Data Factory - ADF Tutorial 2021

Issue: How To Write String Type Variable Value To Text File In Azure Data Factory.

In this article, we are going to learn how to write string type variable value to a text file in the Azure data factory, let's start our demonstration.

First of all open the Azure Data factory, then go to the Author tab, then click on the pipeline, and then click on the new pipeline.


 


Then name the pipeline and click on the Variables, inside the variable tab, click on the new variable, then name the variable and select the type, and give the default value.




Then click on the Parameters tab and then click on the + New button to create a new parameter, then name the parameter, select the type, and give some default value.




Once we have done with our parameter go to the activities tab search for the Set variable activity and drag it to the working window.



Then click on the set variable activity and then go to the Variables tab, then select the variable which we created already. 




Then click on the value and add dynamic content and then click ok.



Once we are done with our variable click on the debug and it will change the value of our variable.





Then go to the activities tab and bring the copy data activity and connect with the et variable activity.



Now click on the copy data activity and then go to the source tab, and then click on the + New button to create a new source dataset.



Then select Azure blob storage and the click on continue.





Then select the file format, which is CSV file (Delimited Text) and the click on continue.



Then Click on + New to create a new linked service.




Select the Azure subscription and then select the storage account, then test the connection and then click on create.


Then Select the file path, then select import schemas as From Connection/store and then click on ok.





Then go to the additional columns and click on + New.


Then name the column and set the variable value.





Then Click on the sink tab and then click on + New button to create new sink dataset.



Then select the Azure blob storage and then click on continue.



Then select the file format which is CSV (Delimited Text) and then click continue.




Then select the linked service which we have created and click ok.


 
Then Select the output container, then select import schemas as  From connection/store and then click on ok.



Then Click on the Open button and provide the file name.



Then go to the Mapping tab and click on the Import Schemas button.



Once you click on import schemas it will show you the list of columns, select the column which you want to delete or add the column as per your requirement, then go back and click on debug.




Once the debug will complete go to your blob sotorage then go to the containers and inside the output folder you will find your output file.






Video Demo: How to write String Type Variable Value to Text File in Azure Data Factory



No comments:

Post a Comment