I have a SQL database with tables for Staff and Appointments (1 staff : many appointments). I'd like to use Azure Data Factory to output this to nested JSON in a Blob store in a format similar to the below:
[
{
"staffid":"101",
"firstname":"Donald",
"lastname":"Duck",
"appointments":[
{
"appointmentid":"201",
"startdate":"2020-02-01T00:00:00",
"enddate":"2020-04-29T23:00:00"
},
{
"appointmentid":"202",
"startdate":"2020-01-01T00:00:00",
"enddate":"2020-01-31T00:00:00"
}
]
},
{
"staffid":"102",
"firstname":"Mickey",
"lastname":"Mouse",
"appointments":[
{
"appointmentid":"203",
"startdate":"2020-02-01T00:00:00",
"enddate":"2020-04-29T23:00:00"
},
{
"appointmentid":"204",
"startdate":"2020-01-01T00:00:00",
"enddate":"2020-01-31T00:00:00"
}
]
}
]
I've tried using the Copy activity but this produces flat JSON structures rather than the nested structure described above. Has anyone got a way to do this please?