← All AZ-400 Flashcard Decks

Pipeline Variables and Templates Flashcards

7 cards from real AZ-400 practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Pipeline Variables and Templates flashcards as text
  1. Which YAML pipeline feature lets you define a reusable set of steps in one file and include them in multiple jobs across different pipelines?

    Answer: Step templates referenced with `- template:` inside a `steps:` block

    Step templates are YAML files containing a `steps:` list that can be included in any job using `- template: path/to/steps.yml`.

  2. What is a key security benefit of using `templateContext` when passing data to a required template?

    Answer: It allows the template to validate and restrict what the extending pipeline can configure

    The `templateContext` property lets the required template inspect and validate properties passed by the consuming pipeline, enforcing security constraints.

  3. A pipeline uses a variable group named 'Production-Secrets' that requires approval. At which point in the run is the approval gate triggered?

    Answer: When the stage or job that references the variable group is about to execute

    Approval gates on protected variable groups are triggered when the stage or job referencing the group is about to begin execution.

  4. You need a pipeline parameter that accepts only 'dev', 'staging', or 'prod'. Which parameter definition enforces this constraint?

    Answer: type: string with `values: [dev, staging, prod]`

    Azure DevOps YAML pipeline parameters support a `values:` list under a `type: string` parameter to restrict accepted inputs to a predefined set.

  5. How do you make an output variable from a matrix job available to a downstream job?

    Answer: Reference it using `$[dependencies.JobName.MatrixLeg.outputs['stepName.varName']]`

    Matrix job outputs are referenced downstream using `$[dependencies.JobName.MatrixLegName.outputs['stepName.varName']]`, where the matrix leg name is the strategy key.

  6. Which statement about pipeline-level variables defined in the Classic (GUI) editor versus YAML is TRUE?

    Answer: Classic pipeline variables can be set as secret and are accessible as $(varName) in both Classic and YAML pipelines

    Variables defined in the Classic pipeline editor can be marked secret, and their $(varName) macro syntax works the same way in YAML pipelines that reference them.

  7. What is the correct way to pass a variable group into a template as a parameter so the template can reference its variables?

    Answer: Link the variable group directly in the pipeline's `variables:` section; its variables are automatically available inside included templates

    Variable groups linked in the pipeline-level `variables:` section are resolved before execution and their variables are available throughout all included templates without additional passing.