Courseiva
Design and implement build and release pipelineseasyMultiple ChoiceObjective-mapped

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

Network Topology
az deployment group createresource-group MyRGtemplate-file main.bicepparameters storageName=mystgaccountRefer to the exhibit.```bash```

You run the above Azure CLI command to deploy a Bicep template. The deployment fails with 'The resource 'Microsoft.Storage/storageAccounts/mystgaccount' already exists'. What is the most likely cause?

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 storage account 'mystgaccount' already exists in the resource group.

The error message 'The resource 'Microsoft.Storage/storageAccounts/mystgaccount' already exists' indicates that the storage account 'mystgaccount' already exists in the target resource group, which prevents the deployment from creating it again. This directly supports option A as the correct answer. Option B is incorrect because 'az deployment group validate' only validates the template and does not perform a deployment; the error occurs during the actual deployment, not validation. Option C is incorrect because Bicep defaults to incremental mode, not complete mode, and even if complete mode were used, the error would be about a resource existing in the template but not in the resource group, which is not the case here. Option D is incorrect because if the resource group did not exist, the error would be something like 'ResourceGroupNotFound', not an already-exists error.

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 storage account 'mystgaccount' already exists in the resource group.

    Why this is correct

    The deployment fails because Azure Resource Manager's default 'create' mode (used by 'az deployment group create' when no mode is specified) issues a conflict error if a resource with the same name and type already exists in the target resource group, even if the template's properties match the existing resource. The storage account 'mystgaccount' already occupies that name in 'MyRG', so the deployment cannot proceed.

  • The command should use 'az deployment group validate' instead.

    Why it's wrong here

    Using 'az deployment group validate' would only check the template syntax and parameter values against the resource group, returning validation errors without actually attempting to create or modify any resources. Since the error is a deployment-time conflict from trying to create an existing storage account, validation would not trigger that error and would not accomplish the goal of deploying the Bicep file.

  • The Bicep file uses 'complete' mode.

    Why it's wrong here

    'Complete' mode in ARM deployments deletes resources in the resource group that are not defined in the template, but it does not cause a 'creation failed' error for existing resources. In fact, if 'complete' mode were used, the storage account might still be recreated or updated, but the typical error for an existing resource in 'complete' mode is different; moreover, Bicep files default to 'incremental' mode unless explicitly set with 'mode: complete', and the error described is a resource-level conflict, not a mode-related deletion.

  • The resource group 'MyRG' does not exist.

    Why it's wrong here

    If the resource group 'MyRG' did not exist, the Azure CLI command would fail with a distinct error indicating the resource group could not be found, such as 'ResourceGroupNotFound'. The error described is specifically about the storage account 'mystgaccount' already existing, not about the resource group, so this option does not explain the issue.

Go deeper

Related to this question

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.