I’ve created a new FunctionApp (.net 8 Isolated) to run a Orchestration workflow, so after test the template generated it worked fine, I was able to debug the orchestrator function, the activity function and see their respective logs.
But after change my Orchestrator and Activity to be Class-based, I don’t see any error happening during the execution, and I see host logs saying that the Orchestratior started and finished, successfully, but I don’t any log from my logInformation that worked before and I don’t see any evidency that my ActivityTrigger run.
[DurableTask(nameof(MyActivity))]
public class MyActivity : TaskActivity<string, string>
{
private readonly ILogger logger;
public MyActivity(ILogger<MyActivity> logger) // activities have access to DI.
{
this.logger = logger;
}
public async override Task<string> RunAsync(TaskActivityContext context, string input)
{
logger.LogInformation("Inside Activity");
return "it's working";
}
}
[DurableTask(nameof(MyOrchestration))]
public class MyOrchestration : TaskOrchestrator<string, string>
{
public async override Task<string> RunAsync(TaskOrchestrationContext context, string input)
{
ILogger logger = context.CreateReplaySafeLogger<MyOrchestration>(); // orchestrations do NOT have access to DI.
// An extension method was generated for directly invoking "MyActivity".
return await context.CallMyActivityAsync(input);
}
}
I’ve tried the Function-Based rollback and worked fine, changing only the ActivityTrigger to Class-based, it does not enter when I’m debugging, neither I see any logs, but there is no error during the execution.