Microsoft DevOps Engineer Expert (AZ-400) · Section 4 · 13% of the exam
Choose between Microsoft Entra service principals and managed identities for Azure resources (system-assigned and user-assigned)
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
Pipelines need identities to reach Azure, GitHub and Azure DevOps. This lesson compares Microsoft Entra service principals with system-assigned and user-assigned managed identities, then ranks the credentials GitHub offers (GITHUB_TOKEN, GitHub Apps, personal access tokens) and covers Azure DevOps service connections and personal access tokens.
Points to remember
- Microsoft Entra ID is the new name of Azure Active Directory (Azure AD); an app registration is global, its service principal is the local instance.
- A managed identity has no credentials to manage and works only for code running on Azure resources; system-assigned dies with the resource, user-assigned is shared and persistent.
- Hosted runners and Microsoft-hosted agents use workload identity federation (OIDC) with a federated credential; an app or user-assigned managed identity allows up to 20 federated credentials.
- GITHUB_TOKEN is per job, limited to its repository and shaped by the
permissionskey; restricted default is read-only contents and packages. - GitHub Apps give short-lived (1 hour) installation tokens and are the preferred non-personal credential beyond GITHUB_TOKEN; fine-grained PATs beat classic PATs.
Try a question
A platform team needs automation that opens pull requests in 40 repositories of a GitHub organization. The pull requests must start normal CI workflow runs. The credential must not depend on an employee account and should expire quickly. What should the team use?
- AA GitHub App installed on the 40 repositories, using installation tokens
- BThe GITHUB_TOKEN of the workflow that creates the pull requests
- CA classic personal access token with the repo scope owned by the team lead and stored as an organization secret
- DA deploy key added to each repository and used with an SSH agent in the automation
Show the answer
A. GitHub Apps give short-lived, non-personal tokens with chosen permissions across the repositories where they are installed. GITHUB_TOKEN is repository-scoped and events it causes generally do not start new runs.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Workload identities and credentials: Entra, GitHub and Azure DevOps teaches this objective (about 50 minutes), and 10 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
- 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 pipelines to prevent leakage of sensitive information
- Design a strategy for security and compliance scanning, including dependency, code, secret, and licensing scanning
- Configure Microsoft Defender for Cloud DevOps Security