1
votes

So I'm experiencing some issues in Azure Data Factory. I have a standard pipeline where I'm trying to implement a webhook for later callbacks, but the body for the webhook post does not seem to be behaving.

(In advance: sorry for the image URLs -> I'm not reputable enough to post images)

So here is what I've typed into the "Body" of the Webhook service: https://imagizer.imageshack.com/img922/3765/ApbiRN.jpg

Then I verify that the template looks correct: https://imagizer.imageshack.com/img924/5448/vN82Vp.jpg

And finally I debug the pipeline only to find this as output from the webhook: https://imagizer.imageshack.com/img923/3697/AEDzOT.jpg

As you can see it's grabbing a {"Key":"Value"} from somewhere. Now I've saved the pipeline; I've published the pipeline; I've restarted ADF.. Still.

So the first issue is that I'm not able to send the body that I want. The second issue is that I'd like to parameterize the body (when this is cleared up):

{
  "key1":"@{pipeline().parameters.param1}",
  "key2":"@{pipeline().parameters.param2}",
  "key3":"@{pipeline().parameters.param3}"
}

I've not been able to solve that last one either, so if any kind souls would be so kind.. much obliged!

Edit: In addition I've not been able to spot the "callBackUri" that the documentation promises: https://docs.microsoft.com/en-us/azure/data-factory/control-flow-webhook-activity

Any insights into that issue as well?

1

1 Answers

2
votes

I tried many times and finally succeeded.
In your case, you can use the expression as follow:

@json(concat(concat('{"key1":"',pipeline().parameters.param1,'",'),concat('"key2":"',pipeline().parameters.param2,'",'),concat('"key3":"',pipeline().parameters.param3,'"}')))

The result is as follow:

enter image description here

  1. First, we need to concatenate the query string.
  2. Then we need to use @json() to convert the string type to json type.