I have a function app that we are upgrading from the In-Process Model to the Isolated Worker Model.
Below I have a dumbed-down, pseudocode version of what I am working on with the relevant method signature and call.
[FunctionName("DummyFunctionName")]
public async Task RunDummyFunction([TimerTrigger("%DummyTrigger%")] TimerInfo timerInfo,[ServiceBus("%DummyQueue%", EntityType = ServiceBusEntityType.Queue, Connection = "DummyConnectionString")] IAsyncCollector<string> queue)
{
await _manager.DoStuff(queue);
}
We are passing the IAsyncCollector to the _manager.DoStuff. In that method, it will eventually call await queue.AddAsync(n1) where n1 is an IEnumerable string.
With the upgrades to the isolated worker model, I am unable get that IAsyncCollector anymore and pass it to the function.
I know I can decorate an object with the ServiceBus and return the object, but that is not going to return a Task in _manager.DoStuff. For example, we cannot do what it says in this article: https://weblogs.asp.net/sfeldman/functions-isolated-worker-sending-multiple-messages because it doesn’t return a Task.
This might be helpful too: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus-output?tabs=python-v2%2Cisolated-process%2Cnodejs-v4%2Cextensionv5&pivots=programming-language-csharp#example
Please advise! Thank you!