AZ-400 ยท Identity, access and permissions
Azure DevOps service connections and PATs
Service connection types and authentication (workload identity federation, service principal, managed identity), scoping and sharing, PAT scopes/lifetime and policies, Microsoft Entra tokens.
Key points
- Service connection: pipeline access to Azure, no sign-in each time.
- Azure Resource Manager: workload identity federation recommended (app registration or managed identity), no secret.
- Scope: needed subscription, management group or resource group; authorize pipelines individually.
- PAT: tied to a user; organization-scoped, minimal scopes, short-lived.
- Automation: Microsoft Entra tokens, service principals, managed identities.
Source: https://learn.microsoft.com/en-us/azure/devops/pipelines/library/connect-to-azure?view=azure-devops
Practice questions
Which authentication option is recommended for a new Azure Resource Manager service connection?
- Workload identity federation
- App registration with a client secret
- Publish profile
- A full-scope personal access token
Show answer
Answer: A. Workload identity federation
Workload identity federation removes secrets and their rotation. Client secrets and publish profiles exist for backward compatibility and edge cases.
Which practices fit secure use of personal access tokens in Azure DevOps?
- Create organization-scoped PATs rather than global ones
- Select only the scopes the task requires
- Keep the lifetime as short as practical
- Share one full-scope PAT across the team for simplicity
- Embed the PAT in the pipeline YAML so it is versioned
Show answer
Answer: A. Create organization-scoped PATs rather than global ones, B. Select only the scopes the task requires, C. Keep the lifetime as short as practical
Use organization-scoped PATs, only the scopes you need and the shortest practical lifetime. Sharing one PAT, using full scope for convenience and relying on global PATs (retiring) are all discouraged.
A personal access token can give its holder more permissions than the user who created it has.
Show answer
Answer: False
False. A PAT identifies its owner and cannot grant more than that owner can do; its scopes can only narrow the access.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
