This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("AsyncHttpFunction")] | |
public static async Task<IActionResult> RunAsync( | |
[HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req, | |
[OrchestrationClient] IDurableOrchestrationClient starter, | |
ILogger log) | |
{ | |
string requestBody = await new StreamReader(req.Body).ReadToEndAsync(); | |
dynamic data = JsonConvert.DeserializeObject(requestBody); | |
string instanceId = await starter.StartNewAsync("Orchestration", (int)(data.secondsToWait ?? 60)).ConfigureAwait(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("Orchestration")] | |
public async Task Run( | |
[OrchestrationTrigger]IDurableOrchestrationContext context, | |
ILogger log) | |
{ | |
int secondsToWait = context.GetInput<int>(); | |
await context.CallActivityAsync(nameof(Function1.LongRunningOperation), secondsToWait); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName(nameof(Function1.LongRunningOperation))] | |
public Task LongRunningOperation([ActivityTrigger]int secondsToWait, ILogger log) | |
{ | |
log.LogInformation($"Doing something really interesting for {secondsToWait} seconds"); | |
return Task.Delay(TimeSpan.FromSeconds(secondsToWait)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "66ee5d08196874aeb99c9e62ddc7b190", | |
"statusQueryGetUri": "https://asynchttpfunction.azurewebsites.net/runtime/webhooks/durabletask/instances/66ee5d08196945aeb44c9e62ddc7b190?taskHub=Orchestration&connection=Storage&code=FSVfJyGODSeKHPO0cM8Po9e1jMT7MghVMGuJqTaGTN56E1RUHnlVJg==", | |
"sendEventPostUri": "https://asynchttpfunction.azurewebsites.net/runtime/webhooks/durabletask/instances/66ee5d08196945aeb44c9e62ddc7b190/raiseEvent/{eventName}?taskHub=Orchestration&connection=Storage&code=FSVfJyGODSeKHPO0cM8Po9e1jMT7MghVMGuJqTaGTN56E1RUHnlVJg==", | |
"terminatePostUri": "https://asynchttpfunction.azurewebsites.net/runtime/webhooks/durabletask/instances/66ee5d08196945aeb44c9e62ddc7b190/terminate?reason={text}&taskHub=Orchestration&connection=Storage&code=FSVfJyGODSeKHPO0cM8Po9e1jMT7MghVMGuJqTaGTN56E1RUHnlVJg==", | |
"rewindPostUri": "https://asynchttpfunction.azurewebsites.net/runtime/webhooks/durabletask/instances/66ee5d08196945aeb44c9e62ddc7b190/rewind?reason={text}&taskHub=Orchestration&connectio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Orchestration", | |
"instanceId": "66ee5d08196945aeb44c9e62ddc7b190", | |
"runtimeStatus": "Running", | |
"input": 10, | |
"customStatus": null, | |
"output": null, | |
"createdTime": "2019-09-17T16:10:17Z", | |
"lastUpdatedTime": "2019-09-17T16:10:18Z" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Start Long Running Task", | |
"type": "AzureFunctionActivity", | |
"typeProperties": { | |
"functionName": "AsyncHttpFunction", | |
"method": "POST", | |
"body": { | |
"secondsToWait": 60 | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Wait For Completion", | |
"type": "WebActivity", | |
"dependsOn": [ | |
{ | |
"activity": "Start Long Running Task", | |
"dependencyConditions": [ | |
"Succeeded" | |
] | |
} |
OlderNewer