I have an Azure Service Bus triggered Azure Function. When I run the Azure Function locally, it starts 16 threads and picks up 16 messages in each thread. How can I configure it so that it only runs one message so that I can debug it without the same breakpoint getting hit 16 times?
I tried to set configuration in host.json file (as below) to only pick up 1 message at a time from Azure Service Bus, but this didn't help.
{
"version": "2.0",
"extensions": {
"serviceBus": {
"prefetchCount": 100,
"messageHandlerOptions": {
"autoComplete": false,
"maxConcurrentCalls": 1,
"maxAutoRenewDuration": "00:55:00"
}
}
}
}
Edit 1: What I currently do is triggering the function's admin endpoint via an http request that contains message input in body. The problem with this is that the http request body has to contain {"input":"{}"} and I have to spend time creating valid json every time with escaped double quotes. Would be much easier if I was able to configure the function to run single message at at time from service bus topic.