Java
Java

Reputation: 1282

Mapping error in Azure Data Factory (connecting JSON in Blob storage to Azure SQL table)

I am trying to map a JSON output (in Blob storage) into Azure SQL table (inside Azure Data Factory).

Currently, my JSON file looks like this:

I validated the JSON format of the output file at https://jsonlint.com/, and it looks fine ("Valid Json").

enter image description here

This is setting that I did for JSON file.

enter image description here

This is screenshot when I preview source data (JSON):

I am not sure why it shows as this (having row with "Prop_0".): enter image description here

This is result when I try to map to Azure SQL table:

enter image description here

What could be the reason that JSON file does not show up with each columns (like "VENDORID", "VENDORNAME", "TOTALPAID" etc.) when I try to connect "Copy data" and map Json file (in Blob storage) to Azure SQL table?

This is additional image after I changed the output file from txt file with .JSON extension to purely JSON file: enter image description here

This is an error message due to mapping issue (txt --> JSON): enter image description here

Thanks.

Upvotes: 0

Views: 442

Answers (2)

Java
Java

Reputation: 1282

I was able to find the solution by having the data type of JSON on next "Copy data" pointing to the text file (csv) that I used. Even though the file was originally created with DelimitedText (csv) file, when I pointed that same file, but using JSON format, it took it. Then, rest process (mapping to SQL table) worked as expected :) enter image description here

Upvotes: 0

KarthikBhyresh-MT
KarthikBhyresh-MT

Reputation: 5034

I see you have, CSV as dataset type created for source, wheras it is a JSON file --> APBILL_output.json

While Creating Source data set for CopyActivity, you would have to choose dataset type as JSON

enter image description here

Example:

enter image description here

Upvotes: 1

Related Questions