Azure Data Factory Rest Linked service returns Array og Json objects instead of Set of Json Objects

Thomas Sørensen 0 Reputation points
2023-03-07T17:11:36.48+00:00

I have set up a Linked Service of type "REST" to copy data from an API to Blob storage. I have a copy activity, which uses a dataset from the Linked Service and a Json dataset on top of a Blob storage Linked service. The API that I am using, supports pagination and I would like for the resulting file to contain a Json object for each response from the API. I do not want the objects in an array, but simply as a set of objects.

So I do not want:

[

{id:1,value:2},

{id:2,value:3}

]

Instead I want

{id:1,value:2}

{id:2,value:3}

I have tried to force the file pattern as below, but without success. image

I have other pipelines where this works just fine for other endpoints and the only difference seems to be in the pagination rule. In the one that does not work, I have the following:

User's image

In the ones that are working, the pagination works as follows:

User's image

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. HimanshuSinha 19,527 Reputation points Microsoft Employee Moderator
    2023-03-08T22:16:54.3733333+00:00

    Hello @Thomas Sørensen , Thanks for the question and using MS Q&A platform.

    Since I dont have the API , what I did I took a JSON as below in a Blob and tried to copy the same to a different container.
    User's image

    I did try to copy this to a different folder, and I just followed your setting. and I got the output as

    User's image

    {"id":28,"Title":"Sweden"}
    {"id":56,"Title":"USA"}
    {"id":89,"Title":"England"}
    
    

    The difference which you are calling out is only for pagination. I have a very strong feeling that the response format for these two API's is also different. Can you please check that ?

    Thanks Himanshu

    Please accept as "Yes" if the answer provided is useful , so that you can help others in the community looking for remediation for similar issues. 


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.