Reputation: 23
I am having difficulties in getting the callback URI from azure data factory when using webhook activity also I am currently calling webjob within the webhook. Inside the webjob I have .Net code but I am not able to get the callback URI.
And I really need to use the the webhook activity because I have a long running job
Upvotes: 1
Views: 6535
Reputation: 23782
Based on this very detailed explanation from this blog and interesting example in this link, at the time of invocation of webhook activity in a pipeline, Data Factory will add an additional field to the JSON body of the request, “callBackUri”, which will be automatically created.(If not,you could set it in the body by youself)
From there you can choose to continue executing in the pipeline, or use Data Factory’s control flows to gracefully handle a failure, or timeout.
Update Answer:
Based on your latest comment,i assume that you want to pass a callbackuri as a parameter into webjob and use it in the webjob inside.
I searched the WebJob REST APi, and got this api:/api/triggeredwebjobs/{job name}/run?arguments={arguments}
To run with arguments use the arguments parameters that will be added to the script when invoked. It also gets passed to the WebJob as the WEBJOBS_COMMAND_ARGUMENTS environment variable
It seems that WebJob only accepts command arguments, so i did a test with a simple Console App.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JayWebJobConsoleApp
{
class Program
{
static void Main(string[] args)
{
Console.Write(args[0]);
}
}
}
Then i invoke the above rest api by https://***.scm.azurewebsites.net/api/triggeredwebjobs/WebJob1/run?arguments=jayuri
,it could be printed in the log:
I also did a test that passing the jayuri in the body but it can't be touched.
So i'm afraid that you have to pass the callbackuri
just behind the webhook uri like uri/arguments=callbackuri as same as my test.
Upvotes: 3