When using the ServiceBusTrigger with Azure Functions to trigger the function to execute on new messages in a Service Bus Queue, their doesn't seem to be a way to auto renew the message timeout. Sure, you can always call the BrokeredMessage.RenewLock method, but with Functions there appears to be no way to configure it to auto renew the message lock.
Is there a way anyone has found to configure an Azure Function to Auto Renew the BrokeredMessage lock while a Service Bus Queue message is being processed?
Yes, I know you can increase the default timeout on the Service Bus Queue, but the maximum configurable default timeout is 5 minutes; which can still be too short .
Thanks!
Here's an example of using the ServiceBusTrigger attribute in C# when building an Azure Function like mentioned using Visual Studio. Notice, the ServiceBusTrigger usage does not allow a Timeout Duration to be set, or an Auto Renew to be configured either.
[FunctionName("MyFunction1")]
public static async Task Run(
[ServiceBusTrigger("queuename", AccessRights.Listen, Connection = "AzureServiceBus")] BrokeredMessage sbCommand,
ILogger log)
{
// process message here
}