The issue you're facing is due to the response data being in JSON-LD format (JSON for Linked Data). When using the Copy Data activity with REST source, ADF sets default headers that may not align with what the API expects in terms of content negotiation.
Root Cause.
ADF’s Copy Data activity sets default headers like Accept: application/json
, which may not align with your API’s requirements. Since your API works in Web Activity and Postman, it's likely expecting a different Accept
header—possibly for JSON-LD (application/ld+json) or another specialized format.
For additional information, please refer: Copy and transform data from and to a REST endpoint by using Azure Data Factory
Resolution.
To resolve the issue, explicitly configure the required headers in your REST dataset used in the Copy Activity. Here’s what you can try adding in the Request Headers:
Accept: application/ld+json
Content-Type: application/ld+json
Authorization: Bearer <your_token>
Ocp-Apim-Subscription-Key: <your_key>
This will ensure that ADF requests are compatible with the API’s expected format and prevent the 406 error.
Make sure:
- The
Authorization
value is formatted exactly as:Bearer <token>
(with a space). - Header names are correctly cased (
Content-Type
, notcontenttype
). - These headers match what works in Postman or Web Activity.
Additional considerations:
If the API returns complex JSON (e.g., JSON-LD), ADF might have trouble flattening it into a tabular format. In that case, consider:
- Using Web Activity to call the API and save the response to Blob Storage.
- Then use Mapping Data Flow or Data Flow activity to parse and load into SQL.
For more details, please refer to the below similar threads for useful insights.
- https://learn.microsoft.com/en-us/answers/questions/1179195/rest-call-failed-with-client-error-status-406-nota
- https://stackoverflow.com/questions/75398029/rest-call-failed-with-client-error-status-code-406-notacceptable
I hope this information helps. Please do let us know if you have any further queries.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.
Thank you.