AI-200 Security And Observability Practice Question
An AI application hosted in Azure App Service throws intermittent socket exhaustion errors under heavy load when calling Azure OpenAI. You suspect improper HTTP client management. How should you fix this in .NET?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use IHttpClientFactory to manage client lifecycles instead of instantiating new HttpClient objects per request.
Using IHttpClientFactory prevents socket exhaustion by managing the lifetime of underlying HttpMessageHandler instances properly.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Configure a private endpoint between the App Service and Azure OpenAI.
Why it's wrong here
Private endpoints secure network paths but do not fix client-side socket exhaustion.
- ✓
Use IHttpClientFactory to manage client lifecycles instead of instantiating new HttpClient objects per request.
Why this is correct
Instantiating HttpClient per request exhausts available TCP sockets; IHttpClientFactory pools them correctly.
- ✗
Enable Always On in the App Service configuration settings.
Why it's wrong here
Always On prevents the app from idling, but does not fix socket leaks.
- ✗
Increase the TCP keep-alive timeout on the Azure App Service instance configuration.
Why it's wrong here
Timeout adjustments do not resolve socket exhaustion caused by abandoning sockets.
About these practice questions
This AI-200 question is part of Courseiva's 503-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Microsoft exam blueprint
This AI-200 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-200 exam.