Microsoft DevOps Engineer Expert (AZ-400) · Section 4 · 13% of the exam
Design pipelines to prevent leakage of sensitive information
One of the objectives of the Exam AZ-400: Designing and Implementing Microsoft DevOps Solutions exam, in the section “Develop a security and compliance plan”. Here is what it covers, the points to remember and a question to try.
What it covers
Store secrets, keys and certificates in Azure Key Vault, replace stored credentials with OpenID Connect in GitHub Actions and Azure Pipelines, ship sensitive files with secure files, and design pipelines so that nothing sensitive reaches logs, forks or untrusted code.
Points to remember
- Key Vault holds secrets, keys and certificates; Azure RBAC is the recommended model and the default for new vaults from API version 2026-02-01, access policies are the legacy model.
- Use Key Vault Secrets User for pipelines that read secrets; Owner/Contributor do not grant data-plane access under RBAC.
- Soft delete is always on (7-90 days, default 90, fixed at creation); purge protection is optional and irreversible once enabled.
- AzureKeyVault@2 downloads secrets as masked variables; variable groups can link to a vault.
- GitHub OIDC needs permissions: id-token: write, a federated credential (issuer https://token.actions.githubusercontent.com, audience api://AzureADTokenExchange) and a tight subject; repositories created after 15 July 2026 use an immutable subject with IDs.
Try a question
A federated credential is configured on an Entra app registration to accept the subject repo:contoso/shop:environment:prod. A deployment job in contoso/shop triggered by a push to main fails to log in. The job contains runs-on: ubuntu-latest, uses azure/login and has id-token: write, but no environment key. Why does it fail, and how do you fix it?
- AThe audience must be api://GitHub; change it on the federated credential and run the job again
- BFederated credentials for GitHub only accept pull_request subjects, so a branch push can never log in
- CThe runner must be self-hosted to present an environment subject; hosted runners can only use branches
- DThe job presents a branch subject; add environment: prod or a branch credential
Show the answer
D. The subject depends on the job context: environment, else pull request, else branch or tag. Add environment: prod to the job, or add a branch credential. For repositories created after 15 July 2026 the subject uses immutable owner and repository IDs, so copy the exact value from the error.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Secrets, Key Vault, OIDC and keeping sensitive data out of pipelines teaches this objective (about 55 minutes), and 15 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.
More in this section
- Choose between Microsoft Entra service principals and managed identities for Azure resources (system-assigned and user-assigned)
- Implement and manage GitHub authentication, including GitHub Apps, GITHUB_TOKEN, and personal access tokens
- Implement and manage Azure DevOps service connections and personal access tokens
- Design and implement permissions and roles in GitHub
- Design and implement permissions and security groups in Azure DevOps
- Recommend appropriate access levels, including stakeholder access in Azure DevOps and outside collaborator access in GitHub
- Configure projects and teams in Azure DevOps
- Implement and manage secrets, keys, and certificates by using Azure Key Vault
- Implement and manage secrets and secretless authentication (for example, workload identity federation/OpenID Connect) in GitHub Actions and Azure Pipelines
- Design and implement a strategy for managing sensitive files during deployment, including Azure Pipelines secure files
- Design a strategy for security and compliance scanning, including dependency, code, secret, and licensing scanning
- Configure Microsoft Defender for Cloud DevOps Security