Reputation: 47
Trying to read REST API endpoints through Synapse pipeline and sinking it in a JSON format. The API response is XML and the run ends up erroring out.
--------Error--------- { "errorCode": "2200", "message": "Failure happened on 'Source' side. 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,''Type=Newtonsoft.Json.JsonReaderException,Message=Unexpected character encountered while parsing value: <. Path '', line 0, position 0.,Source=Newtonsoft.Json,'", "failureType": "UserError", "target": "Copy REST API Data", "details": [] } --------Error---------
Do not want to go back and use existing C# script-based code which is currently run through SSIS packages.
Any assistance will be appreciated.
Upvotes: 0
Views: 494
Reputation: 7156
I tried to repro this using Rest connector in ADF and got the same error. Rest connector supports only JSON file. Refer this Microsoft Document on Supported capabilities of REST connector.
Instead use HTTP connector and select XML dataset. Below is the approach to do it.
Select HTTP in linked service.
Enter Base URL and authentication type and then click create.
Create new dataset for HTTP linked service. Select HTTP and then continue.
Select XML format and then select continue.
Give the linked service and relative url and then click OK.
Use this dataset as source dataset in copy activity. Once pipeline is run, data will be copied to sink.
Upvotes: 0