Microsoft DevOps Engineer Expert AZ-400 Practice Question
You are developing a YAML pipeline that runs on a self-hosted Linux agent packaged as a Docker container. During the build stage, a PowerShell script must call the Azure DevOps REST API to create work items in the same organization. The solution must:
Avoid interactive sign-in or storing user credentials inside the container image or repository.
Allow the token to be revoked without affecting other pipelines.
Which authentication approach should you implement to meet these requirements?
Create an Azure Resource Manager service connection that uses a service principal and reference the connection from the script.
Configure a Microsoft Entra ID application and authenticate the script by obtaining an OAuth 2.0 access token with the client credentials flow.
Generate a personal access token scoped to Work Item write access and store it as a secret in a variable group linked to Azure Key Vault.
Use the built-in System.AccessToken that is automatically injected into every pipeline job.
Storing a personal access token (PAT) that is scoped only to Work Item (read and write) operations inside an Azure Key Vault-backed variable group meets all the stated requirements. A PAT is a non-interactive credential that the script can pass in the Authorization header when calling the Azure DevOps REST API. Because the PAT is stored as a secret variable, it is never embedded in the container image or source code. Revoking or rotating the PAT affects only this pipeline, leaving other pipelines unaffected.
The System.AccessToken is automatically generated for every job and provides the build identity permissions granted to the project. Although it avoids interactive sign-in, it cannot be individually revoked without disabling the pipeline or modifying project-level permissions for the build service account, so it fails the revocation requirement. While you can authenticate with a Microsoft Entra ID application using OAuth 2.0, this method adds more complexity than necessary for this scenario, requiring the setup of an App Registration and managing its permissions in Azure DevOps. The PAT approach is more direct. An Azure Resource Manager service connection authenticates against Azure resources and has no authority over Azure DevOps work item endpoints, so it is not relevant to the scenario.
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 a Personal Access Token (PAT) in Azure DevOps?
Open an interactive chat with Bash
How does Azure Key Vault enhance the security of storing PATs in pipelines?
Open an interactive chat with Bash
Why is System.AccessToken not suitable for this scenario?
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 .