Hello Sinhal, Nikhil,
The auto-renewal feature is available for Azure Functions when they are triggered by Service Bus and allows you to set the maxAutoRenewDuration in the host.json file.
Maximum value: The maximum duration you can configure for auto-renew is 30 minutes.
This means if your function is running for longer than 30 minutes, the auto-renew feature won’t be enough, and you'll have to implement manual lock renewal within your function to keep the message locked for longer periods.
If your function is running for a long time (and less than 30 minutes), you can configure auto-renew in the host.json file like this:
{
"version": "2.0",
"extensions": {
"serviceBus": {
"messageHandlerOptions": {
"autoComplete": false, // Don't auto-complete the message
"maxAutoRenewDuration": "00:30:00" // Max auto-renew duration (30 minutes)
}
}
}
}
Please accept as answer and do a Thumbs-up to upvote this response if you are satisfied with the community help. Your upvote will be beneficial for the community users facing similar issues.
