Courseiva
Design and implement build and release pipelinesmediumMultiple ChoiceObjective-mapped

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

Exhibit

{
  "parameters": {
    "environment": {
      "type": "string",
      "defaultValue": "dev"
    }
  },
  "variables": {
    "resourceGroupName": "rg-$(environment)-001"
  },
  "trigger": "none",
  "pool": {
    "vmImage": "ubuntu-latest"
  },
  "stages": [
    {
      "stage": "Deploy",
      "jobs": [
        {
          "job": "DeployJob",
          "steps": [
            {
              "task": "AzureCLI@2",
              "inputs": {
                "azureSubscription": "MyServiceConnection",
                "scriptType": "pscore",
                "scriptLocation": "inlineScript",
                "inlineScript": "az group create -n $(resourceGroupName) -l westus"
              }
            }
          ]
        }
      ]
    }
  ]
}

Refer to the exhibit. You have this Azure Pipeline YAML. When you run the pipeline, it fails because the resource group name is not correctly resolved. What is the likely cause?

⚠ Common exam trap

A common mix-up: candidates confuse the syntax for referencing parameters (`${{ }}`) with the syntax for referencing variables (`$()`), assuming both are interchangeable in YAML pipelines.

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 variable 'resourceGroupName' uses $(environment) which cannot reference a parameter.

In Azure DevOps YAML pipelines, the `$()` syntax is used to reference runtime variables, not parameters. Parameters are defined using `parameters:` and are referenced with `${{ parameters.parameterName }}`. Using `$(environment)` attempts to resolve a variable named 'environment', but since 'environment' is defined as a parameter, it is not available as a variable at runtime, causing the resource group name to remain unresolved and the pipeline to fail.

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 script type 'pscore' is not supported on Ubuntu.

    Why it's wrong here

    Ubuntu hosted agents ship with PowerShell Core (pwsh), and the script type 'pscore' is the recognized alias for pwsh in Azure DevOps pipeline tasks. Therefore, choosing 'pscore' is valid on Ubuntu; the failure must originate elsewhere in the pipeline definition.

  • The variable 'resourceGroupName' uses $(environment) which cannot reference a parameter.

    Why this is correct

    The macro syntax `$(environment)` in a variable resolves to a runtime variable named 'environment', not to a pipeline parameter. Parameters are expanded at compile time via `${{ parameters.environment }}`, so this use would produce a null/empty value and cause the resource group name to be incorrect or undefined.

  • Parameters cannot be used in YAML pipelines; they must be defined in a template.

    Why it's wrong here

    YAML pipelines support a top-level `parameters` section directly in the main pipeline file, not just inside templates. Parameters are evaluated at queue time and can be referenced with `${{ parameters.name }}`, so the statement is false.

  • The 'trigger: none' prevents the pipeline from running.

    Why it's wrong here

    `trigger: none` only disables automatic CI triggers on commits; the pipeline remains available for manual runs through the Azure DevOps UI, the REST API, or by using the 'Run pipeline' button. Thus, it does not prevent the pipeline from running entirely.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

One of 823 original AZ-400 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.