We are using ServiceBus with a couple of topics and want to try with Azure Functions to make a new function that would be configured with incoming service bus binding for specific topic. We also want to try Consumption plan where Azure itself would maintain this function and we won't need to host it
The problem here is that new messages aren't triggering azure function to start. When Azure function is accessed from azure portal and it's running (based on AppInsights Live), then it processes messages fine. But after 5 minutes of inactivity it stops it. After i push new messages to that topic - it doesn't trigger Azure function to start new host and process new messages.
So my question is: How Azure function maintain ServiceBus subscription? From my understanding it needs to connect to service bus in PeekLock mode and wait for new messages and it's doing it inside of Azure Function when it's running. But what happens if function was stopped by inactivity? Does Azure function somehow subscribes to some to ServiceBus with internal way, so when new message appears it creates new Function hosts and processes messages?
We are using Azure Functions v1 with Deployed way when we have a class library with actual function's code and it's deployed from VSTS. Our events aren't happening too frequently so we would have a couple of events per day. We are connecting to ServiceBus through AMQP and our trigger is declared as function parameter like this:
[FunctionName("SomeFunction")]
public static void Run(
[ServiceBusTrigger("someTopicName","someSubscriptionName", AccessRights.Listen)]
string messageBody,
TraceWriter log)
{