My Azure Functions app (.NET 8 Isolated) is running with max scale-out burst of 4, max 4 instances. This is to save money. My app has an Event Hubs trigger, and the hub has eight partitions.
When scaling out, my app appears to get stuck in a loop. I get messages like this over and over:
Desired target worker count of '10' is not in list of valid sorted workers: '0,1,2,3,4,8'. Using next largest valid worker as target worker count.
Once I start getting these messages, the app essentially hangs, and no new events are processed until I restart the application pool. This happens intermittently. I understand there is a three-minute "grace" period during scaleout where no further instances will be added or removed, but this is extending long past three minutes.
There should be no other consumers in this Hub consumer group.
Has anyone else seen this? How do I prevent it?