Skip to content

Instantly share code, notes, and snippets.

@AnthonyGiretti
Created December 10, 2024 15:26
Show Gist options
  • Save AnthonyGiretti/6ad186cb97c8936eb1931f9e63854de8 to your computer and use it in GitHub Desktop.
Save AnthonyGiretti/6ad186cb97c8936eb1931f9e63854de8 to your computer and use it in GitHub Desktop.
Example of .NET 6 in-process DurableClient
[FunctionName("FlowCleanupOrchestratorTimeTrigger")]
public async Task Run([TimerTrigger("%FlowCleanupTimeTrigger%", RunOnStartup = true)] TimerInfo myTimer,
[DurableClient] IDurableOrchestrationClient client)
{
var instanceId = Guid.NewGuid().ToString();
try
{
_logger.LogInformation($"FlowCleanupOrchestratorTimeTrigger Timer trigger function activated for instanceId: {instanceId}");
await client.StartNewAsync(nameof(FlowCleanupOrchestrator), instanceId);
}
catch (Exception ex)
{
_logger.LogError(ex, $"FlowCleanupOrchestratorTimeTrigger: queue trigger function exception for instanceId: {instanceId}. Details: {ex.Message}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment