Q13 Functions Domain 3 · 20–25% of exam Priority · Real Exam

What is the correct way to share an HttpClient across function invocations?

  1. A Create a new HttpClient per invocation
  2. B Use a static/singleton HttpClient or IHttpClientFactory (correct answer)
  3. C Use a using block per call
  4. D Store it in the function context

Shortcut: Creating a client per invocation exhausts sockets under load. A static instance or IHttpClientFactory reuses connections correctly across invocations on the same instance.