Open lipalath-ms opened 2 years ago
@lipalath-ms can you clarify what you mean by "and adding DurableClient"?
[FunctionName("HttpStart")]
public static async Task<HttpResponseMessage> Run(
[HttpTrigger(AuthorizationLevel.Function, methods: "post", Route = "orchestrators/{functionName}")] HttpRequestMessage req,
[DurableClient(TaskHub = "%MyTaskHub%")] IDurableOrchestrationClient starter,
string functionName,
ILogger log)
{
}
As specified above - should we provide [DurableClient(TaskHub = "%MyTaskHub%")] IDurableOrchestrationClient starter?
This is how I specified in the code: [DurableClient] IDurableOrchestrationClient starter.
public async Task Run(
[TimerTrigger("%schedule%")] TimerInfo myTimer,
[DurableClient] IDurableOrchestrationClient starter,
ILogger log)
{
}
No, you should only define the task hub name in the [DurableClient]
attribute when you want to use the client to target another function app. The default behavior is for the [DurableClient] binding to use the task hub value in host.json (which can be set using the app setting you referenced originally).
So going back to your original question, yes, you can use AzureFunctionsJobHost__extensions__durableTask__hubName
to set the task hub value, but don't bother referencing it in [DurableClient]
; it will be picked up automatically.
Thank you - for clarification I only want to add 'AzureFunctionsJobHostextensionsdurableTask__hubName ' property. no other changes are required to set hub name. Please confirm the same. Thanks!
Yes, this is correct - no other changes are required.
Can this be mentioned in the doc (the doc doesn't mention anything about this property)
Can I set hub name by adding a property 'AzureFunctionsJobHostextensionsdurableTask__hubName' in app setting rather than in host.json and adding DurableClient?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.