Scanning container images before Kubernetes deployment with Microsoft Defender for Containers
Short answer
A Include Microsoft Defender for Containers, which scans container images in Azure Container Registry for vulnerabilities before deployment to the Kubernetes cluster.
Question
You need to scan the app image for vulnerabilities before the image is deployed to the cluster.
What should you include in the solution?
Key Takeaways
The question tests the distinction between scanning an actual container image artifact (Defender for Containers, via ACR) versus scanning source code/IaC/manifests in the pipeline (Defender for DevOps).
To scan a container image for vulnerabilities before deploying it to a Kubernetes cluster, use Microsoft Defender for Containers (A), which scans images pushed to Azure Container Registry using an integrated Trivy-based scanner.
Common mistake: Choosing C, Microsoft Defender for DevOps, because of the phrase "before deployment" — but Defender for DevOps scans code and configuration files, not the container image artifact itself; the image vulnerability scan is performed by Defender for Containers against images in ACR.
Expert Analysis
The core boundary: image-in-registry vs. code-in-pipeline
This question turns on which Microsoft Defender plan actually performs container image vulnerability scanning versus which one scans source code, IaC templates, and manifests. The scenario explicitly asks to "scan the app image for vulnerabilities before the image is deployed to the cluster" — that is a registry/pipeline artifact scan, not a code scan.
Why option A is correct
Microsoft Defender for Containers performs vulnerability assessment of container images stored in Azure Container Registry (ACR) using an integrated Trivy-based scanner. Images are scanned when pushed to ACR, i.e., before they are pulled and deployed to the Kubernetes cluster. It also adds runtime Kubernetes protection, but the pre-deployment image scan in ACR is exactly the capability the question requires. This is the long-standing AZ-400 doctrine for "scan image before deploying to AKS."
Why option C is the trap
Several community comments argue for C, Microsoft Defender for DevOps, leaning on the phrase "before the image is deployed." One comment claims "Defender for DevOps scans before deployment, Defender for Containers does not scan before deployment." That framing is misleading: Defender for DevOps primarily scans source code, IaC, and manifest files in Azure DevOps/GitHub repos — it is a code-and-configuration scanner, not an image vulnerability scanner. Defender for Containers, by contrast, scans the actual image artifact in ACR prior to cluster deployment, which is precisely the requested action.
Why B and D are wrong
B, Defender for App Service, protects App Service web apps, not Kubernetes workloads or container images. D, Defender for Storage, protects blob/container storage accounts against data threats, not container image vulnerabilities. Neither touches the image-deployment pipeline for a Kubernetes cluster.
Official Reference
https://learn.microsoft.com/en-us/azure/defender-for-cloud/defender-for-containers-introduction
This link opens the official vendor documentation in a new tab.
Exam Strategy
When an AZ-400 question asks about scanning a container image for vulnerabilities, identify the artifact being scanned: an actual image in a registry points to Microsoft Defender for Containers (Trivy-based ACR scanning), while source code, IaC, or manifest files point to Defender for DevOps. Watch for the keyword "image" versus "code" or "manifest," and remember that Defender for Containers covers both pre-deployment registry scans and runtime Kubernetes protection, so "before deployment" does not exclude it.
Community Votes
60% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 9 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 9
-
17b9160 👍 3Provided answer is correct : A https://learn.microsoft.com/en-us/azure/defender-for-cloud/defender-for-containers-introduction
-
vsvaid 👍 2Correct, Defender for containers
-
Dats1987 👍 2Given ans is correct. A
-
Theguy97 👍 2 Answered Aanswer is correct : A
-
8fc2e85 👍 1 Answered CDefender for DevOps I think https://learn.microsoft.com/en-us/azure/defender-for-cloud/azure-devops-extension. It'll scan the image artefact. Defender for containers sounds more runtime.
Show 4 more comments
-
wyvern99 👍 1 Answered CKey: before the image is deployed. Defender for DevOps scans before deployment, Defender for Containers does not scan before deployment.
-
Dkijc 👍 1It does say it uses 3rd party Trivy for container images... Why do they always make these kinds of questions??
-
UrbanRellik 👍 1 Answered AA. Kubernetes is a containerized solution for web apps.
-
ozbonny 👍 1 Answered AA. Microsoft Defender for Containers
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All AZ-400 Questions
Access 100 questions with complete answers and detailed explanations.
View Full AZ-400 Practice Test →