String Type Variable in Azure Data Factory | How to Save Output of Activity to String Type Variable

Topic: String Type Variable in Azure Data Factory.

In this article, we are going to learn about string type variables in the Azure data factory, we will also learn how to save the output of activity to string type variable, we will create a pipeline, in this pipeline, we will create a variable then will copy data from our Azure SQL database to the variable. let's start our demonstration.

Open your Azure data factory studio, go to the Author tab, click on the pipeline, then click on New pipeline to create a new pipeline.


In the pipeline, click on the white canvas, go to the Variables tab, click on the + New button to create a new variable, name your variable, select the type, then provide the values.


Find and bring the lookup activity, go to the settings tab, click on the + New button to create a new source dataset.


Select Azure SQL database, then click on continue.


Name your dataset, then create a new linked service, name your link service, select Azure subscription, server name, provide database name, select authentication type, provide your username and password then click on create and then click on Ok.


In the settings tab select the query, then provide the SQL query.


Find and bring the set variable activity, then go to the Variables tab, select the variable, in the value click on '' add dynamic content'' then select the lookup and at the end of expression add ''.firstrow.col'', then click on Debug to execute the pipeline.



In another scenario, I am going to get the data from REST API and write it into a variable, create a new pipeline, find and bring the web activity, go to the settings tab, provide the URL, then in the method select GET.



Click on the white canvas, go to the Variables tab, click on the + New button to create a new variable, name your variable then select the variable type.


Find and bring the set variable, connect with the web activity, go to the Variables tab, select the variable we created, in the value click on Add dynamic content and select the web activity, and then click on 
Debug to execute the pipeline.   



Video Demo: String Type Variable in Azure Data Factory - How to Save Output of Activity to String Type Variable


No comments:

Post a Comment