Please take a look at the following information, which basically details the methods available to implement connection pooling with Azure Functions along with a specific example of Connection Pooling with Azure Database for MySQL in Java. This logic needs to be written into your function app.
To avoid holding more connections than necessary, reuse client instances rather than creating new ones with each function invocation. We recommend reusing client connections for any language that you might write your function in. For example, .NET clients like the HttpClient, DocumentClient, and Azure Storage clients can manage connections if you use a single, static client.
Here are some guidelines to follow when you're using a service-specific client in an Azure Functions application:
- Do not create a new client with every function invocation.
- Do create a single, static client that every function invocation can use.
- Consider creating a single, static client in a shared helper class if different functions use the same service.
Provides a code sample for implementing Connection Pooling in Java for Azure Database for MySQL.