Farbic Copy Data Activity encountering an error(failed to read data) when attempting to read data from an REST API

user1 0 Reputation points
2025-07-09T16:34:32.1333333+00:00

While using Microsoft Fabric, when I attempt to write a REST API call into a lakehouse files using a copy activity inside a pipeline I get an error stating that

  1. Error details Error code 23360 Details Fail to read from REST resource. Found invalid data while decoding. Activity ID

or

  1. Failure happened on 'Source' side. ErrorCode=RestResourceReadFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Fail to read from REST resource.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.IO.InvalidDataException,Message=Found invalid data while decoding.,Source=System,'

I have a working environment in PostMan which reads the data in JSON format, the only thing I think might be the issue is some weird arrays and lists in the output which might be screwing up the copy activity but I do not see how it would break it, let me know if you have any ideas on how I can fix this issue or the potential cause of the problem

Azure Service Fabric
Azure Service Fabric
An Azure service that is used to develop microservices and orchestrate containers on Windows and Linux.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alex Burlachenko 13,330 Reputation points Volunteer Moderator
    2025-07-10T07:43:18.9766667+00:00

    Hi user1 looks like u're having a bit of trouble with that rest api data copy in fabric, mon ami ...

    that 'invalid data while decoding' error usually pops up when the copy activity gets confused by the json structure. since postman works but fabric doesn't, it's probably how fabric's parser handles those arrays u mentioned. try adding explicit json format settings in your copy activity source. u can force it to treat the response as json document even if the structure is weird. https://learn.microsoft.com/en-us/azure/data-factory/format-json

    also check if u can modify the rest api call to return simpler json. sometimes adding '$top=10' parameter helps test with smaller data chunks. fabric can be picky about nested arrays )) when dealing with messy json, always validate the structure first. u can use online json validators or postman's pretty print to spot irregularities. worth looking into. check the http headers in postman that work and replicate them exactly in fabric. sometimes missing 'accept: application/json' header causes these parser errors.

    merci for bringing this to the q&a! let us know if those nested arrays are still causing trouble ) maybe we can suggest more tricks % )

    Best regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    

    https://ctrlaltdel.blog/

    0 comments No comments

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.