How should json look like to be valid for azure Data factory

Tony Johansson 40 Reputation points


I have a REST API that send these data when using Advanced Rest Client with method Get


The REST API is done in .NET/C#

The endpoint look like this in C#

public ActionResult Reservations(string start, string end)
            DbApi dbApi = new DbApi(Configuration);
            dbApi.GetGuestNights(start, end);
            IEnumerable<Booked> bookedList = dbApi.GetLodgingOccupancy(start, end);

            var json = JsonSerializer.Serialize(bookedList);

            return Ok(json);

When I use Azure Data Factory and request the REST API I get the following response error back. When I get a valid resonse I will just send the output to a json file.

			"Code": 21155,
			"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,'",
			"EventType": 0,
			"Category": 5,
			"Data": {
				"FailureInitiator": "Source"
			"MsgId": null,
			"ExceptionType": null,
			"Source": null,
			"StackTrace": null,
			"InnerEventInfos": []

I call the REST API like this 

The response I get back when I use Advanced Rest Client is a valid json so why can't azure Data factory understand the json it get back

Thank in advance

Tony Johansson
Microsoft Technologies based on the .NET software framework.
3,632 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,157 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,634 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce ( 61,416 Reputation points

    Most likely the response is html, either an error page, or login page.

0 additional answers

Sort by: Most helpful