AI-200 practice question · Connect to and Consume Azure Services
A .NET application calls the Azure OpenAI SDK client types directly from dozens of business classes.
A .NET application calls the Azure OpenAI SDK client types directly from dozens of business classes. The team wants to be able to move some features to a different model provider later without changing those classes, and to add telemetry and caching in one place. What should they do?
- AHave business classes depend on the IChatClient interface from Microsoft.Extensions.AI and register a provider-specific implementation through dependency injection
- BStore the Azure OpenAI endpoint and deployment name in Azure App Configuration so the business classes can switch models without being redeployed
- CWrap every Azure OpenAI SDK call in the business classes with a shared retry and circuit-breaker resilience policy
- DHave business classes depend on the IEmbeddingGenerator interface from Microsoft.Extensions.AI and send chat prompts through it
Show the answer and explanation
Correct answer: A) Have business classes depend on the IChatClient interface from Microsoft.Extensions.AI and register a provider-specific implementation through dependency injection
Microsoft.Extensions.AI provides IChatClient, a provider-neutral abstraction. Business code that depends on it can switch model providers through dependency injection, and cross-cutting middleware such as telemetry and caching can be added in one place.
Why each option is right or wrong
- A) Correct. IChatClient is a provider-neutral chat abstraction. Microsoft Learn recommends coding against these abstractions instead of hardcoding to one AI service, which gives portability across models and services. The Microsoft.Extensions.AI package also lets you add middleware such as OpenTelemetry and caching to the client pipeline.
- B) Incorrect. Moving settings into configuration lets the team change deployments within Azure OpenAI, but the business classes still use Azure OpenAI SDK types. Switching to another provider would still mean changing every class.
- C) Incorrect. Resilience policies deal with transient failures. They don't remove the direct dependency on Azure OpenAI client types, so the provider coupling stays.
- D) Incorrect. IEmbeddingGenerator is the abstraction for generating embeddings, not for chat. Chat interactions use IChatClient.
- Exam domain
- Connect to and Consume Azure Services · 25% of AI-200
- Question type
- Multiple choice (one answer)
Related AI-200 questions
- A team deploys an Azure OpenAI model as a Standard deployment and validates its application against the current model…Connect to and Consume Azure Services
- A team has finished a fine-tuning job in Azure OpenAI and now has a custom model ID such as…Connect to and Consume Azure Services
- An application lets users record a spoken question. It must turn the prerecorded audio file into written text and then…Connect to and Consume Azure Services
- Three applications run on an App Service web app, an Azure Container Apps app, and an Azure Functions app.Connect to and Consume Azure Services
All 60 free AI-200 questions by domain · 15 sample questions on one page
Practise the full AI-200 exam
This question is one of a small free sample from the CertRidge AI-200 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.
Original question written from the official exam guide. Not affiliated with Microsoft; never copied from the real exam.