Can you read a file content entriely within Data Factory

Abhijit Nath 21 Reputation points
2020-07-10T15:05:30.33+00:00

Is there a way to read contents of a file entirely within a Azure Data Factory. Lets say the file is a simple text file, stored in Data Lake Gen2 as a Blob.
Please note, i am not looking to Copy the file or transform the file, instead i just need to read the file content entirely within the ADF pipeline.

I can easily do the same within a Logic App using "Get Blob", but it seems I haven't found a way in ADF.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,639 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MartinJaffer-MSFT 26,036 Reputation points
    2020-07-20T20:29:32.34+00:00

    @AbhijitNath-2966

    There are multiple ways to get data into the pipeline and available as activity output.

    Lookup activity is the easiest, but it has volume limitations.

    A web activity is another method. Most Azure services have a REST API. By pointing the web activity at the REST API endpoint for the service in question, you can fetch the data. Using web activity is harder than the Lookup, because the authentication is not as in-built.

    For Gen2 / Blob, the process is to get a Bearer Token, then use it in the Authorization header of subsequent calls.
    13111-3step.jpg

    The first step is identical to Step 5 in using OAuth with REST connector.

    The remaining steps are similar, except using Web Activity instead of Copy Activity.
    To get the data, the URL should look like
    GET https://{accountName}.{dnsSuffix}/{filesystem}/{path}

    You will need to add a header, 'Authorization' , and the value should use the token @concat('Bearer ',variables('token'))

    0 comments No comments