0

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)
{
mathewc
  • 13,312
  • 2
  • 45
  • 53
Sergey Litvinov
  • 7,408
  • 5
  • 46
  • 67
  • Everything seems correct in your setup. Do I understand correctly that messages stay in subscription? Seems similar to [this issue](https://github.com/Azure/Azure-Functions/issues/350) which is said to be fixed but is still open... Maybe open a new issue similar to [this](https://github.com/Azure/Azure-Functions/issues/681). – Mikhail Shilkov May 17 '18 at 12:18
  • Do try force resyncing your triggers by hitting the Refresh button. If that doesn't work, please provide your app details privately ([instructions here](https://github.com/Azure/azure-functions-host/wiki/Sharing-Your-Function-App-name-privately)) along with a timeframe so we can check our logs. – mathewc May 17 '18 at 18:28
  • I did Resync through Azure CLI tools and it returned Sucess. But it still doesn't start hosts. I changed AccessRights to Manage, but still it processes them only if i navigate to function from Azure Portal. So looks like ScaleController can't pick up function configuration somehow. I'll create a ticket on GitHub and then will add updates there if i would be able to resolve it. Thanks! – Sergey Litvinov May 18 '18 at 11:59
  • @mathewc i created GitHub issue with timeframe\InvocationID data - https://github.com/Azure/azure-functions-host/issues/2869 – Sergey Litvinov May 18 '18 at 12:51

0 Answers0