Data factory : get full content of a text file and put it into a variable

sakuraime 2,351 Reputation points
2021-11-03T09:24:13.143+00:00

In Data factory , are there any activity where I can read the full content of a text file and set it to a variable ?

Get metadata seems doesn't have this option . While also in Loopup activity seems it parse the file and return array values. Thanks

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MartinJaffer-MSFT 26,161 Reputation points
    2021-11-03T19:54:05.243+00:00

    Welcome back @sakuraime . You were very close to having it.
    You can get the whole text file with lookup, but you need to specify delimiters which do not exist in the entire file. For this I recommend using control characters such as bell. The results may be returned in a single-element array, but that shouldn't be a problem.

    Depending upon the source, you may also be able to fetch the content with a Web activity. This approach is more work, as you need to do the authentication and headers, etc.

    I have tried to find the limits of Set Variable. I don't recall the exact limit, but casual use did not run into it. You might run into a limit if you tried to store a gigabyte file or the text of a full-length novel.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.