ADF Copy Activity Copying Only 1 Row

Lolas-4729 10 Reputation points
2023-08-01T21:14:02.3+00:00

Team,

I have an ADF copy activity.

Purpose: Query Log Analytics Workspace > Write Results to Azure SQL DB

Problem: Only 1 row being written to SQL DB.

1

Copy activity Settings

1

2

Content-Type below. Request body with KQL query. No Pagination rules added

2

3

Details of Base and Relative URLs

3

4

Source Preview successfully shows KQL query results. Only UPN result is expected from the query in the Request Body

4

5

Mapping from Source to Destination; selecting only the required field

6

6

Copy activity completes without error

7

7

SQL DB receives just 1 row

8

Any assistance is greatly appreciated.

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

5 answers

Sort by: Most helpful
  1. Lolas-4729 10 Reputation points
    2023-08-02T07:57:37.4933333+00:00

    Hi Team, here is the solution for my case:

    Please note that the [0] refers to the position in the JSON. So if I add more fields to my KQL results, I would need to map [1], [2], etc.

    Solution

    1 person found this answer helpful.

  2. Lolas-4729 10 Reputation points
    2023-08-03T15:23:05.46+00:00

    The solution was to Map complex values to String > Change the Collection Reference to $[‘tables’][0][‘rows’] > Rows became an Array [] > then map the json field [0] to the UPN in SQL column.

    This is now resolved for me.

    1 person found this answer helpful.
    0 comments No comments

  3. AnnuKumari-MSFT 34,451 Reputation points Microsoft Employee
    2023-08-18T11:57:26.9333333+00:00

    Hi Lolas-4729,

    Glad that you figured out the way to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Complex values needs to be mapped to String . To achieve it , we need to Change the Collection Reference to $[‘tables’][0][‘rows’] and then map the Json field with index 0 to the user principal name in SQL column.

    Kindly accept the answer by clicking on Accept answer button so that the solution reaches the community in case anyone is facing similar issue. Thankyou.

    1 person found this answer helpful.
    0 comments No comments

  4. Subashri Vasudevan 11,226 Reputation points
    2023-08-02T04:30:31.9266667+00:00

    Hi Lolas-4729

    Thanks for using MS Q&A Portal and for your question. I think all steps you mentioned are ok, except step 5. As highlighted below, we are just mentioning the copy activity to bring just one row (rows[0][0])

    Screenshot 2023-08-02 at 9.58.55 AM

    What you can try?

    Please remove the indexing part from rows and just mention ['rows'] and see if that fixes the issue.

    Let us know how it goes

    0 comments No comments

  5. Lolas-4729 10 Reputation points
    2023-08-02T07:11:47.2133333+00:00

    Good morning. I tried this. See below:

    I tried with $['rows'] - Copy activity completed but no value(s) is inserted into SQL table.

    Rows1

    I then tried just ['rows'] and ['rows'][0]; in both of these cases the Copy Activity fails.

    Details: ErrorCode=JsonUnsupportedHierarchicalComplexValue,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The retrieved type of data JArray is not supported yet. Please either remove the targeted column 'userPrincipalName' or enable skip incompatible row to skip the issue rows.,Source=Microsoft.DataTransfer.Common,'

    Rows2


Your answer

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