Courseiva
Configure processes and communicationsmediumMultiple ChoiceObjective-mapped

AZ-400 Configure processes and communications Practice Question

Exhibit

Refer to the exhibit.
$resourceId = '/subscriptions/123/resourceGroups/rg-dev/providers/Microsoft.Network/virtualNetworks/vnet-dev'
$tags = @{Environment='Dev'; CostCenter='12345'}
New-AzResource -ResourceId $resourceId -Tag $tags -Force

You run the PowerShell command shown in the exhibit. The virtual network already exists. What is the outcome?

⚠ Common exam trap

Candidates may assume `New-Az*` cmdlets always create new resources and error if the resource exists, but `New-AzResource` supports both create and update, so it updates the existing resource.

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 virtual network's tags are updated to the specified tags.

The `New-AzResource` cmdlet can create a new resource or update an existing resource. If the virtual network already exists, the cmdlet updates it, including applying the specified tags. The `-Force` parameter suppresses confirmation prompts and does not determine create vs. update behavior.

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 virtual network's tags are updated to the specified tags.

    Why this is correct

    The New-AzResource cmdlet with the -Force switch and a fully qualified ResourceId performs an in-place update of the existing virtual network's properties. Since the command specifies the existing resource's ID and the -Force parameter overrides the default error for existing resources, only the tags are applied, leaving the virtual network itself untouched.

  • The virtual network is deleted and recreated.

    Why it's wrong here

    This option is incorrect because New-AzResource does not delete and recreate the virtual network when -Force is used. Instead, it updates the existing resource's metadata in place, so the virtual network's identity, configuration, and underlying infrastructure remain unchanged while only the specified tags are set.

  • An error occurs because the virtual network already exists.

    Why it's wrong here

    An error would normally occur if you attempted to create a resource that already exists without the -Force parameter, but the command in the exhibit includes -Force. This switch tells Azure Resource Manager to update the existing virtual network rather than raise an error, so the command succeeds and no error is thrown.

  • A new virtual network with a different name is created.

    Why it's wrong here

    The command uses a specific ResourceId that points directly to the existing virtual network, so there is no creation of a new resource. New-AzResource with -Force either creates a new resource if the ID does not exist or updates the existing one; here it updates the existing network's tags, and the name remains unchanged.

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.