Home > front end >  Azure function with Service Bus trigger calls the namespace with no reason
Azure function with Service Bus trigger calls the namespace with no reason

Time:07-10

I have the following code:

[FunctionName("myFunc")]
public static void Run([ServiceBusTrigger("myQueue", Connection = "ConnectionString")]string myQueueItem, ILogger log)
{
    log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
}

It is published in an Azure Function App that has Managed Identity configured to a namespace. The app shows no executions (no messages have been sent to the queue/namespace): enter image description here

Yet, at the same time the namespace shows it has received requests: enter image description here

The namespace has no other queues and NOTHING else connects/accesses/requests the namespace and queue. Also, if the function app is stopped the requests stop, as well.

I'm trying to figure out why would the function app send requests to the namespace (and so many) when it wasn't even triggered.

CodePudding user response:

At least one reason that I can think of is that it could be monitoring the queue length. Azure Functions will auto-scale up/down based on the number of messages in the queue after all.

  • Related