Azure / Azure/azure-functions-host
Many outbound connections generated from Azure Functions
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
System setup that pertains to the issue;
Azure Function Service Bus Trigger
Which makes Database calls to the Azure SQL Server
Above is a snapshot of the connection count captured for part of the month November. Earlier function app was running on the consumption plan & it hit the limit of 600 connections. So we upgraded it to the Premium plan & noticed a sudden increase. Further checking on TCP connections, observed a large number of connections have been made to the Service Bus as recognized by the following image;
1) What could be the cause of many outbound TCP connections made to the Service Bus?
2) The application doesn't entangle with this Service Bus anywhere else other than as an input binding to the Azure Function. What is the mechanism where it triggers Azure Function each time it receives a message to the Service Bus? Is it polling?
Whatever the underlying mechanism is, how can I avoid making that many calls to the Service bus from Azure Function? This is another observation; it makes more connections as Azure Function gets triggered more (Many incoming messages to the Service Bus). I could be wrong in this too, but would like to add this as if it can help with furthering on this matter.
Code-level details;
Within Azure Functions I have registered Service Bus as a singleton service.
```[tasklist]
### Tasks
```
Contributor guide
Research direction
The issue names an Azure Functions Service Bus trigger, Azure SQL, and connection-count/TCP observations but no source files, tests, or entry points. Start by investigating the trigger's connection behavior and whether message volume, polling, or the registered singleton explains the growth. Done means the cause and a supported way to reduce unnecessary Service Bus connections are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, sql
- Domain
- backend, cloud, databases
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100