AI-102 Plan and manage an Azure AI solution Practice Question
Your company uses Azure OpenAI to generate code snippets. Developers need to ensure that the generated code does not contain security vulnerabilities. What should you implement?
⚠ Common exam trap
Test-takers frequently confuse Azure OpenAI content filters (which handle text-level safety) with code-level security scanning, leading them to incorrectly select Option C, while the correct approach requires a dedicated security analysis tool integrated into the development pipeline.
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
✓
Integrate a static code analysis tool into the CI/CD pipeline to scan generated code
Integrating a static code analysis tool (e.g., Microsoft Defender for DevOps, SonarQube, or Checkmarx) into the CI/CD pipeline allows automated scanning of generated code for security vulnerabilities before deployment. This approach directly addresses the requirement to ensure generated code is free of vulnerabilities, as Azure OpenAI content filters are not designed to detect code-level security flaws like SQL injection or buffer overflows.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set usage quotas to limit the number of code generation requests
Why it's wrong here
Quotas cap request volume for cost and capacity control; they do not inspect generated code, so vulnerable snippets still reach developers. Quotas are tempting as a governance lever, but they are designed to throttle usage, whereas the scenario requires scanning output for security flaws before acceptance.
- ✗
Fine-tune the model on a dataset of secure code examples
Why it's wrong here
Fine-tuning adjusts style and domain behaviour from examples; it cannot guarantee absence of vulnerabilities and may still emit insecure patterns. It is tempting because secure examples appear instructive, but fine-tuning is intended to shape task performance, not to enforce security validation of each generated snippet.
- ✗
Configure Azure OpenAI content filters to block vulnerable code
Why it's wrong here
Content filters classify harmful categories such as violence or hate, not code correctness or vulnerability patterns; they cannot detect insecure constructs like SQL injection. They are tempting because they are the built-in safety layer, but they are intended for harmful-content moderation, not static security analysis of generated code.
- ✓
Integrate a static code analysis tool into the CI/CD pipeline to scan generated code
Why this is correct
Static analysis scans generated code for known vulnerability patterns such as injection flaws or insecure API use before merge, catching issues that prompt engineering alone cannot guarantee. Integrating it into CI/CD enforces this check consistently on every generated snippet.
Go deeper
Related to this question
About these practice questions
One of 761 original AI-102 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AI-102 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-102 exam.