Availability of HttpClientFactory for Azure Functions v2
14
I want to know if HttpClientFactory or similar is available for Azure Functions v2.
Below is what is recommended, but HttpClientFactory or similar is not shown.
// Create a single, static HttpClient
private static HttpClient httpClient = new HttpClient();
public static async Task Run(string input)
{
var response = await httpClient.GetAsync("https://example.com");
// Rest of function
}
https://learn.microsoft.com/en-gb/azure/azure-functions/manage-connections
Below is a good link but I am not sure if it can be used on production, or
https://www.tpeczek.com/2018/12/alternative-approach-to-httpclient-in.html
Problem to solve
1 Providing managed HttpClient pool instead of single HttpClient, like HttpClientFactory in ASP.NET CORE 2.2