Courseiva
Configure and manage automation of tasksmediumMultiple ChoiceObjective-mapped

DP-300 Configure and manage automation of tasks Practice Question

You need to automate the creation of an Azure SQL Database using Azure CLI in a CI/CD pipeline. The database name must be unique and include the build ID. How should you specify the database name in the Azure CLI command?

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

Use an environment variable $(Build.BuildId) set by the pipeline

In Azure DevOps pipelines, $(Build.BuildId) is a predefined variable that provides a unique build ID. This can be used in Azure CLI commands to create a unique database name, e.g., 'mydb-$(Build.BuildId)'. Option A ($RANDOM) is Bash-specific and not reliable across pipeline runs. Option B (uuid) is not a valid Azure CLI function. Option C (hardcoded name) fails on pipeline rebuilds due to name conflicts.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use the $RANDOM variable in Bash

    Why it's wrong here

    $RANDOM is not reliable for uniqueness and not available in all shells.

  • Use the $(uuid) function in Azure CLI

    Why it's wrong here

    There is no $(uuid) function in Azure CLI.

  • Use a hardcoded name like 'mydb'

    Why it's wrong here

    Hardcoded names cause conflicts when the pipeline runs multiple times.

  • Use an environment variable $(Build.BuildId) set by the pipeline

    Why this is correct

    Azure DevOps provides unique build IDs that can be referenced as environment variables.

About these practice questions

One of 906 original DP-300 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 DP-300 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 DP-300 exam.