The Lookup activity in Azure Data Factory is designed for
retrieving a dataset from any supported data source. It can be particularly
useful when you need to fetch configuration data or look up values that will be
used in subsequent activities within your data pipeline.
ADF- What is the Lookup activity in ADF?
Definition:
Lookup is an activity in ADF used to get data set from any
data source supported by Azure Data Factory.
- Lookup activity can return the results of a
query or a stored procedure execution.
- Lookup activity can read and return the results
of a configuration file.
- Lookup activity output can a be a singleton
value or an array of the attributes.
- Lookup activity output data size should not
exceed 4 MB. The activity will give an error if the size is more than that.
- Lookup activity can return up to maximum 5000 rows and if it exceeds it
will return first 5000 rows.
ADF – Lookup
activity implementation
Requirement:
-
Get the data from a SharePoint List.
Implementation:
- Create a new Linked service to SharePoint.
This is self-explanatory so we are not going to cover Linked service creation
here. You can see the screenshot of the linked service in Edit mode.
- Create a Dataset using the linked service we
created above.
- You need to specify the linked service, List
Name from where you need data. After you configure, you can click on
Preview Data to see the data.
- Now, add a Lookup activity.
- Click on the Settings tab.
- As you can see in the screenshot, you need to
select the Source Dataset.
- If you want to narrow down the result set, then
you can also specify a filter in the query section which will return
only the rows that match the condition specified.
- If you tick First row only, it will only
return the first row from the dataset.
ADF Lookup
activity features
- Reading
or Looking Up Data: The Lookup activity can read or look up a record, table
name, value, or dataset from any external source. This output can then be
referenced by succeeding activities in your pipeline.
- Support
for Various Data Sources: It supports a wide range of data sources,
including relational databases, file-based data, and cloud data stores,
provided they are supported by Azure Data Factory.
- Single
Row or Multiple Rows: By default, the Lookup activity retrieves a single
row from the data source. However, you can configure it to return multiple rows
by setting the "First row only" property to false.
- Usage in
Dynamic Content: The results from a Lookup activity can be used in
subsequent activities for dynamic content. For example, you can use the output
of a Lookup activity as parameters for a Copy activity or to dynamically define
the activities executed within a ForEach activity.
- Integration
with Other Activities: The output of the Lookup activity can be easily
integrated with other ADF activities through expressions and parameters. This
allows for dynamic pipelines that adjust their behavior based on the data
retrieved by the Lookup activity.