AZ-400 Practice Question: Design and implement build and release pipelines
Your team uses GitHub Actions to build a Docker image and push it to Azure Container Registry (ACR). The workflow fails with the error 'unauthorized: authentication required'. The workflow uses the 'azure/docker-login@v1' action. What is the most likely cause?
⚠ Common exam trap
A common mix-up: candidates assume the error means the login itself failed, but the 'azure/docker-login@v1' action can succeed with a valid service principal that lacks push permissions, and the 'unauthorized' error surfaces only during the subsequent docker push, leading test-takers to incorrectly suspect admin credentials or Dockerfile location.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The service principal used for authentication lacks the AcrPush role on the ACR.
The 'azure/docker-login@v1' action authenticates Docker with Azure Container Registry using a service principal. If the service principal lacks the AcrPush role, Docker login succeeds but the subsequent push fails with 'unauthorized: authentication required' because the identity does not have permission to push images. The error occurs at push time, not login time, which is a key diagnostic clue.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The 'azure/docker-login@v1' action does not support ACR.
Why it's wrong here
The azure/docker-login@v1 action explicitly supports Azure Container Registry; it accepts a registry name and credentials (username/password or service principal) and performs docker login against ACR, so the claim that it does not support ACR is incorrect.
- ✗
The Dockerfile is not in the repository root.
Why it's wrong here
The Dockerfile location affects the build context and would cause a 'no such file or directory' error, not an authentication failure. Since the error is about authentication when pushing to ACR, the Dockerfile not being in the repository root is not the cause.
- ✓
The service principal used for authentication lacks the AcrPush role on the ACR.
Why this is correct
To push an image to Azure Container Registry, the authenticated identity (here, the service principal) must have the AcrPush role granted on the registry. If that role is missing, docker login succeeds but docker push fails with a permissions error, making this the likeliest root cause of the push failure.
- ✗
The workflow uses the registry admin credentials, which are disabled.
Why it's wrong here
Using registry admin credentials is an alternative to a service principal, but when a service principal is used for authentication, admin credentials are not required. If they are disabled, that does not affect a service-principal-based login, so this is not the cause of the push error.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
GitHub
GitHub is a cloud-based platform for storing, tracking, and collaborating on code using Git version control.
Key term
Service principal
A service principal is an identity created for an application or automated tool to access cloud resources securely without using a human user account.
About these practice questions
This AZ-400 question is part of Courseiva's 823-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.