Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
dworka
Regular Visitor

Copy Data activity fails when API returns top-level JSON array

Scenario:

I’m using the REST connector with a Copy data activity to pull data from a custom API and ingest it into a Lakehouse. The API response is valid JSON, but it returns the payload as a top-level array ([ ... ], i.e., an array of objects) rather than a top-level object ({ ... }).

 

It looks like Copy data expects the response to be a JSON object, and fails when the root element is an array.


Error:
ErrorCode=JsonInvalidDataFormat,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Error occurred when deserializing source JSON file ''. Check if the data is in valid JSON object format.,Source=Microsoft.DataTransfer.ClientLibrary,'

Question:
Is there any way to configure the Copy data activity to handle a JSON array at the root and avoiding this error — without changing the API?

3 REPLIES 3
v-achippa
Community Support
Community Support

Hi @dworka,

 

Thank you for reaching out to Microsoft Fabric Community.

 

In Fabric the copy activity with the REST connector does not support a top level json arrays, this is a product limitation.
The recommended approach is to use a fabric notebook to call the API and write the result to the lakehouse, since the spark natively supports json arrays.
Alternatively, we can use Dataflow Gen2 because it can ingest array based json payloads.

 

Thanks and regards,

Anjan Kumar Chippa

Hi @v-achippa,

 

Thank you for the confirmation and prompt response.

 

I don’t think I can use a Fabric notebook because my API is behind a Data Gateway.

 

That leaves me with Dataflow Gen2, which we chose and which seems to work fine. However, we’re running into separate issues related to authorization for the mentioned API. From what I understand, these should be resolved in the future through planned features, so they’re not critical to this discussion.

 

In the meantime, support for top-level JSON arrays in Copy Activity would be the best solution for us. It also seems strange to me that Copy Activity doesn’t support this. Is there any chance this could be supported in the future?

Hi @dworka,

 

Thank you for the clarification.

 

If the API is accessible only through a data gateway, then you are correct that a fabric notebook will not be a suitable option.

Regarding future support, currently we are not able to confirm the roadmap commitments here.

If support for top-level JSON arrays in Copy activity would significantly improve your scenario, I recommend submitting your detailed feedback and ideas through Microsoft's official feedback channels. Product engineers do review the feedback there when prioritizing enhancements.

Fabric Ideas - Microsoft Fabric Community

 

Thanks and regards,

Anjan Kumar Chippa

Helpful resources

Announcements
Free Fabric Certifications

Free Fabric Certifications

Get Fabric certified for free! Don't miss your chance.

January Fabric Update Carousel

Fabric Monthly Update - January 2026

Check out the January 2026 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.