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
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.WebJobs; | |
namespace DurableFunc | |
{ | |
public static class HelloWorld | |
{ | |
[FunctionName("HelloWorld")] |
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
{ | |
"IsEncrypted": false, | |
"Values": { | |
"AzureWebJobsStorage": "UseDevelopmentStorage=true", | |
"AzureWebJobsDashboard": "UseDevelopmentStorage=true", | |
"WeatherApiKey": {Weather-API-Key}, | |
"OrchestrationClientUri": "http://localhost:7071/api/orchestrators/", | |
"MaxExecutionTime": "3000", | |
"ExecutionPeriod": "100" | |
} |
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("SyncResponseClient")] | |
public static async Task<HttpResponseMessage> Run( | |
[HttpTrigger(AuthorizationLevel.Function, methods: "post", Route = "orchestrator/{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); |
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
public async Task<object> ProvideOutput(OrchestrationClientResponse clientResponse, ExecutionDetails executionDetails, TraceWriter log) | |
{ | |
object result = null; | |
using (var httpClient = new HttpClient()) | |
{ | |
for (var i = 0; i < executionDetails.Iterations; i++) | |
{ | |
Thread.Sleep(executionDetails.IterationPeriod); | |
string statusCheck; |
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
using System; | |
using System.Net; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using System.Configuration; | |
using DurableFunc.Model; | |
using DurableFunc.Services; | |
using DurableFunc.Utils; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Extensions.Http; |