Courseiva
Design and implement build and release pipelineshardMultiple ChoiceObjective-mapped

AZ-400 Practice Question: Design and implement build and release pipelines

Exhibit

Refer to the exhibit.
```json
{
  "name": "Deploy to AKS",
  "type": "DeployPipeline",
  "environment": "production",
  "strategy": {
    "runOnce": {
      "deploy": {
        "steps": [
          {
            "task": "Kubernetes@1",
            "inputs": {
              "kubernetesServiceConnection": "aks-prod",
              "namespace": "prod",
              "manifests": "$(Build.ArtifactStagingDirectory)/deployment.yaml"
            }
          }
        ]
      }
    }
  },
  "approvals": [
    {
      "approvers": [
        "user@contoso.com"
      ]
    }
  ]
}
```

Refer to the exhibit. This is a deployment job definition in a multi-stage YAML pipeline. The deployment fails because the Kubernetes service connection 'aks-prod' cannot be found. What is the most likely cause?

⚠ Common exam trap

It's easy for candidates to confuse a missing service connection with runtime issues like namespace existence or agent permissions, but the error message is explicit about the connection not being found in the Azure DevOps project, not about a failure to connect to the cluster.

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 connection 'aks-prod' does not exist in the Azure DevOps project.

The error message explicitly states that the Kubernetes service connection 'aks-prod' cannot be found. In Azure DevOps, a service connection is a stored credential set that must exist in the project before it can be referenced in a YAML pipeline. If the connection name is misspelled, deleted, or never created, the pipeline will fail at the deployment job stage regardless of other configurations.

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 approval for production environment is blocking the deployment.

    Why it's wrong here

    Approvals in Azure DevOps are tied to environment gates and stages; a pending approval would leave the deployment job in a 'Waiting' state, not produce a 'not found' error. The error is raised at runtime when resolving the service connection, which is unrelated to approval checks.

  • The agent pool does not have access to the AKS cluster.

    Why it's wrong here

    The agent pool executes the deployment job and uses the service connection for authentication to AKS, but the error 'service connection not found' explicitly indicates the connection object is missing from the project's service connections. Agent pool membership or permissions do not affect the existence or resolution of the service connection definition.

  • The service connection 'aks-prod' does not exist in the Azure DevOps project.

    Why this is correct

    The YAML deployment job references `aks-prod` via the `azureSubscription` or `connectionRef` field, and Azure DevOps must resolve this to an existing service connection in the project before any Kubernetes interaction occurs. If no service connection named `aks-prod` exists, the pipeline fails with a 'not found' error during the configuration phase, confirming this as the root cause.

  • The namespace 'prod' does not exist in the AKS cluster.

    Why it's wrong here

    If the `prod` namespace were missing, the failure would occur later during the manifest apply step (e.g., `kubectl apply`) with an error like 'namespaces "prod" not found'. The initial error about `aks-prod` arises before any cluster communication, so namespace absence would not produce that specific error.

About these practice questions

Courseiva writes every AZ-400 question from scratch — 823 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.