inspiredd
inspiredd

Reputation: 217

WebHook Azure Data Factory pass variables

I have a WebHook activity in Azure Data Factory pipeline but I'm not able to pass variables here.

@json('{
"body": "@{pipeline().parameters.body}",
"name": "@{variables('name')}"
}')

There is a problem with '. I've tried with \'name\' but it does not work.

Upvotes: 0

Views: 1583

Answers (1)

KarthikBhyresh-MT
KarthikBhyresh-MT

Reputation: 5034

The body representing the payload to be be sent to endpoint must be Valid JSON or an expression that results a value of type JSON. So in WebHook activity you can just pass the JSON string rather than using the function json() again.

Checkout this example:

Use any string variable:

enter image description here enter image description here

Using the variable and parameter in JSON string:

{
   "var":"@{variables('variable')}",
   "param":"@{pipeline().parameters.parameter}",
   "age":"23"
}

enter image description here

by string interpolation, the value of variable is replaced in place

enter image description here

Upvotes: 4

Related Questions