I have HTTP trigger which invokes orchestra function. In HTTP trigger function I receive json string which I deserialize into object . However I have no idea how to pass this object to orchestra function or activity functions.
I have tried to include it as parameter of orchestra function but it gives me error
HTTP trigger
#load "../Shared/jsonObject.csx"
public static async Task<HttpResponseMessage> Run(
HttpRequestMessage req,
DurableOrchestrationClient starter,
string functionName,
ILogger log)
{
HttpContent requestContent = req.Content;
string jsonContent = requestContent.ReadAsStringAsync().Result;
jsonObject bsObj = JsonConvert.DeserializeObject<jsonObject> (jsonContent);
// Pass the function name as part of the route
string instanceId = await starter.StartNewAsync("Orchestra", bsObj);
log.LogInformation($"Started orchestration with ID = '{instanceId}'.");
return starter.CreateCheckStatusResponse(req, instanceId);
}
Orchestra function
#load "../Shared/jsonObject.csx"
[FunctionName("Orchestra")]
public static async void Run(DurableOrchestrationContext context)
{
var output = await context.CallActivityAsync<int>("checkConditions", bsObj);
}
Activity functionn not implemented yet
#load "../Shared/jsonObject.csx"
public static string Run(jsonObject bsObj)
{
return "done";
}
[Error] run.csx(19,74): error CS0103: The name 'bsObj' does not exist in the current context