-
When working with durable task framework inside of the console application, we can easily create the client and do the following: var client =new ServiceBusOrchestrationService(serviceBusConnectionString, taskHubName, instanceStore, null, null);
var client = new TaskHubClient(orchestrationServiceAndClient);
var instance = taskHubClient.CreateOrchestrationInstanceAsync(typeof(HelloOrchestration), new Random().Next().ToString(), null).Result; Durable Entities also offers a similar way by using IDurableEntityClient. The IDurableEntityClient is designed for injection, which works fine in frameworks like ASP.NET and AzFunctions. I tried to create the instance of the IDurableEntityClient in the same way as the instance of the TaskHubClient shown in the code above and find it very difficult. For this reason, I'm asking what is the right way to instantiate the IDurableTaskClient? We are missing that part of the documentation at all. For example: void Main(string[] args)
{
IDurableEntityClient client = new XYZ(ConfigXyz);
client...
} By following this, it would also be helpful to provide a document that shows how all of IXYClients in DurableFunction-world can be used inside of the console application including the configuration of all existing backend providers. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The One option you can consider is self-hosting the Azure Functions runtime (specifically, the WebJobs SDK) in a console app. This would allow you to use all the Azure Functions bindings in your own console app. You can find some basic instructions for doing this here: https://docs.microsoft.com/azure/azure-functions/durable/durable-functions-webjobs-sdk#webjobs-sdk-3x. |
Beta Was this translation helpful? Give feedback.
The
IDurableEntityClient
is a binding for the Durable Functions extension of Azure Functions. It's not designed to work with the Durable Task Framework directly. In fact, Durable Entities is only supported in Durable Functions and doesn't have any equivalent in the Durable Task Framework (though we're considering backporting it at some point). It also requires the storage provider to understand how to work with entities, and the DurableTask.ServiceBus dependency that you're using in your example doesn't support entities.One option you can consider is self-hosting the Azure Functions runtime (specifically, the WebJobs SDK) in a console app. This would allow you to use all the Azure Functi…