Azure Data Factory external call POST request body empty

TDay 0 Reputation points
2025-04-28T12:25:34.8933333+00:00

In Azure Data Factory I am using the "External Call" action to generate a POST request to an external API:

ContactColumns call(mapColumn(
		firstname,
		lastname
	),
	skipDuplicateMapInputs: true,
	skipDuplicateMapOutputs: true,
	output(
		headers as [string,string],
		status as string
	),
	allowSchemaDrift: true,
	format: 'rest',
	store: 'restservice',
	timeout: 30,
	requestInterval: 0,
	httpMethod: 'POST',
	headerColumnName: 'headers',
	bodyColumnName: 'body',
	statusColumnName: 'status',
	addResponseCode: true,
	requestFormat: ['type' -> 'json'],
	responseFormat: ['type' -> 'json', 'documentForm' -> 'documentPerLine'])

I have temporarily used a Postman mock server as the API endpoint for debugging.

When I try to preview the output data and select 'Copy request payload' - this is what ADF says has been requested of the API endpoint:

Uri: https://<redacted>.mock.pstmn.io

Method: POST

Headers: content-type: application/json | accept: application/json

Body: {"firstname":"TEST1","lastname":"tester1"}

This is what postman receives:

Headers:

x-forwarded-for``: "xxxxxxxxx"

x-forwarded-proto``: "xxxxxxxxx"

x-forwarded-port``: "xxxxxxxxx"

host``: "<redacted>.mock.pstmn.io"

x-amzn-trace-id``: "Root=<redacted>"

content-length``: "42"

content-type``: "application/json"

accept``: "application/json"

user-agent``: "azure-data-factory/2.0"

content-encoding``: "UTF-8"

accept-encoding``: "gzip,deflate"

Body:

{} NOTE ISSUE: this should not be blank

Error message: Request body has invalid format.

See image: User's image

The postman response is consistent with the issue I receive when using my real API endpoint (a logic app). I can't find any information online about this issue, so any help would be very gratefully received!

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,464 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Venkat Reddy Navari 1,585 Reputation points Microsoft External Staff
    2025-04-28T12:57:08.8633333+00:00

    Hi @TDay You're correct — the runtime body {} should not be blank.

    This happens because in Azure Data Factory (ADF) External Call, even though the "Copy request payload" shows the correct JSON (with firstname and lastname), at runtime ADF expects a body field to be explicitly mapped. If you don't map the body, ADF sends {} — an empty body — by default.

    In your External Call configuration, you need to build the body field manually, for
    Example:

    body => toJson({
        "firstname": firstname,
        "lastname": lastname
    })
    

    Make sure your External Call activity is configured with:

    • Request Body Column Name = body
    • Request Format = JSON

    Once mapped correctly, ADF will send the full JSON object at runtime instead of {}.

    It's understandable this was confusing — ADF's preview shows what would be sent if mappings were complete, but it doesn't warn if runtime mappings are missing.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.