Microsoft DevOps Engineer Expert AZ-400 Practice Question
You are designing a GitHub Actions pull request workflow with two jobs: build and analyze. The build job builds a Linux container image, tags it with the commit SHA, and pushes it to an Azure Container Registry (ACR).
According to security policy, the analyze job must run CodeQL static analysis from inside the container image created by the build job. This ensures that only tools from the hardened image are used and that no additional tools are installed on the GitHub-hosted runner.
How should you configure the analyze job to meet this requirement?
Add the option build-mode: container under the github/codeql-action/init step in the analyze job.
Add the parameter run-in-container: true to every CodeQL action step in the analyze job.
In the analyze job, set a container property only on the github/codeql-action/analyze step.
Make the analyze job dependent on the build job using the needs property, and add a container property to the analyze job that references the image in ACR.
The correct approach involves a two-job workflow. The analyze job must be configured to run only after the build job completes successfully; this is accomplished by adding a needs: build property to the analyze job. To run all of the job's steps inside the desired container, the container property is specified at the analyze job level, referencing the image that the build job pushed to the registry. This ensures the entire analysis, including the CodeQL init, build, and analyze steps, runs in the hardened container environment. The other options propose using non-existent parameters like build-mode or run-in-container, or incorrectly scope the container to a single step, which would not satisfy the security requirement for the entire analysis process.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the 'needs' property in GitHub Actions, and why is it important?
Open an interactive chat with Bash
How does the 'container' property work at the job level in GitHub Actions?
Open an interactive chat with Bash
What is CodeQL, and why is it run inside the container in this workflow?
Open an interactive chat with Bash
Microsoft DevOps Engineer Expert AZ-400
Develop a security and compliance plan
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .