Developing Microsoft Azure and Web Services — Question 83

You deploy a RESTful ASP.NET Web API to manage order processing.
You are developing an Azure App Services Web App to consume the API and allow customers to order products. You use the HttpClient object to process order entries. The API throws SocketException errors when the Web App experiences a high volume of concurrent users.
You need to resolve the errors.
What should you do?

Answer options

Correct answer: C

Explanation

The correct answer is C because using a static HttpClient instance allows for better resource management and avoids socket exhaustion during high traffic. Options A and B do not address the underlying issue of socket management, while option D can lead to performance degradation due to the overhead of creating multiple instances.