AZ-400 Configure processes and communications Practice Question
Your organization uses GitHub for code and GitHub Actions for CI/CD. You want to enforce that all workflows include a 'codeql-analysis' job for security scanning. What is the best approach?
⚠ Common exam trap
Watch out — candidates often confuse 'workflow templates' (which are optional) with 'required workflows' (which are mandatory), or they mistakenly believe that branch protection rules can enforce the existence of a workflow job, when in fact they only enforce the outcome of a status check that may not even be configured.
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 GitHub's required workflows feature to mandate specific workflows
GitHub's required workflows feature allows organization owners to enforce that specific workflows (like a CodeQL analysis) run on all repositories in the organization, ensuring consistent security scanning without relying on templates or manual setup. This is the only approach that centrally mandates the workflow's presence and execution across all repositories, even if developers create new workflows or modify existing ones.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a workflow template and add it to the organization's workflow templates directory
Why it's wrong here
Workflow templates, stored in the .github/workflow-templates directory, only appear as starting points when new workflows are created from the GitHub UI; existing repositories are not migrated, and there is no enforcement mechanism to require that a repository actually uses the template, so CodeQL scanning cannot be mandated across the organization.
- ✗
Use branch protection rules to require a status check named 'codeql-analysis'
Why it's wrong here
Branch protection rules can only require that a CI status check named codeql-analysis has completed successfully before merging. They do not create or install a CodeQL workflow; if a repository lacks the workflow, the check simply never appears or remains pending, and no scanning actually runs. Consequently, this approach cannot guarantee or enforce that any repository performs CodeQL analysis, and it only affects branches with protection rules configured.
- ✗
Create a custom GitHub Action that runs CodeQL and require it in all workflows
Why it's wrong here
A custom action is merely a reusable unit, and while you can reference it in a workflow, GitHub does not provide a way to force every repository's workflows to include that action; repositories under the organization can define their own workflows without using the action, so it does not guarantee CodeQL runs everywhere.
- ✓
Use GitHub's required workflows feature to mandate specific workflows
Why this is correct
GitHub's required workflows feature (in public beta for organizations) lets administrators designate a workflow file in a central repository that is automatically created in all repositories and cannot be removed or modified by users; this ensures CodeQL scanning runs consistently across every repository in the organization.
Go deeper
Related to this question
Learn chapter
Implementing Security and Compliance in Pipelines
Key term
GitHub
GitHub is a cloud-based platform for storing, tracking, and collaborating on code using Git version control.
Key term
Feature
A feature is a distinct unit of functionality that delivers value to the user, often managed and tracked throughout the software development lifecycle.
About these practice questions
Courseiva writes every AZ-400 question from scratch — 696 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-400 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 AZ-400 exam.