我是Durable函数(Orchestration函数)的新手,并且按照Microsoft文档可以看到示例应用程序。所以我几乎没有怀疑。如何通过定时器触发调用Durable功能?
例如:
public static async Task<HttpResponseMessage> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, methods: "post",
Route = "orchestrators/{functionName}")] HttpRequestMessage req,
[OrchestrationClient] DurableOrchestrationClient starter,
string functionName,
TraceWriter log)
{
// Function input comes from the request content.
dynamic eventData = await req.Content.ReadAsAsync<object>();
string instanceId = await starter.StartNewAsync(functionName, eventData);
log.Info($"Started orchestration with ID = '{instanceId}'.");
return starter.CreateCheckStatusResponse(req, instanceId);
}
调用它我使用邮递员所以请求成功处理的HTTP POST请求,但我被配置成当不同的动词像HTTP GET将其用在控制台NOTFOUND”错误回答以及请求作出它与浏览器的HTTP请求报以“NOTFOUND”错误控制台。为什么会发生?
我可以在定时器触发蔚蓝的功能调用任何业务流程与功能?
如果不是,为什么?
UPDATE:
有关问题一些额外的细节
[FunctionName("TimerTrigger")]
public static async Task Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, TraceWriter log)
{//this runs for every 5minutes
using (HttpClient client = new HttpClient())
{
var content = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("", "")
});
//making request to above function by http trigger
var result = await client.PostAsync("http://localhost:7071/orchestrators/E1_HelloSequence", content);
}
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
return;
}
我可以请求HTTP触发由计时器triggred为什么,因为我的耐用功能具有长期运行的进程,所以如果在计时器调用业务流程功能触发自己,所以可能会有计时器触发超时的可能性,以便我试图按照这种方法。是否可以通过上面的代码调用?
谢谢...我的问题通过上述方案解决 –