I am trying to teach myself Azure Data Factory and am attempting some "simple" API exercises.
I successfully loaded data from an API call into a SQL database using the copy data activity and adding the simple mapping.
However, this was for an API call that returned a single JSON object as below.
{
"id": "tt0110413",
"title": "Léon: The Professional",
"year": "1994",
"releaseDate": "1994-11-18",
"runtimeMins": "110",
"plot": "12-year-old Mathilda is reluctantly taken in by Léon...",
"imDbRating":"8.5"
}
I would like to progress this to be able to handle an array of JSON objects as below.
{
"items":
[
{
"id": "tt0111161",
"title": "The Shawshank Redemption"
},
{
"id": "tt0068646",
"title": "The Godfather"
},
{
"id": "tt0468569",
"title": "The Dark Knight"
}
],
"errorMessage": ""
}
I have naively thought this would be a simple matter pointing the copy data activity at the new JSON and updating the mapping as required.
However I now receive the following error:
Data type of column 'id' can't be inferred from 1st row of data, please specify its data type in mappings of copy activity or structure of DataSet
Would someone be able to advise on how I change the mapping to handle this, or if in fact this is entirely the wrong approach.
As always, any help is greatly appreciated.


