Question 506 of 999

Quick Answer

The correct answer is that all resources without tags receive the tag 'Environment' with value 'Unknown'. This outcome occurs because the `Update-AzTag` cmdlet with the `-Operation Merge` parameter adds or updates the specified tags on each resource without removing any existing tags; for resources that already have tags, only the new tag is appended, while for resources lacking any tags, the entire specified tag is applied. On the Microsoft Azure Solutions Architect Expert AZ-305 exam, this concept tests your understanding of Azure resource tagging behavior and the subtle difference between Merge, Replace, and Delete operations, which is a common trap—candidates often assume Merge only updates existing tags and forgets untagged resources. To remember, think of Merge as "add or fill": it adds the tag to existing tags, or fills the tag onto empty resources, but never removes what is already there.

AZ-305 Practice Question: Design identity, governance, and monitoring solutions

This AZ-305 practice question tests your understanding of design identity, governance, and monitoring solutions. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Exhibit

Refer to the exhibit.

$resources = Get-AzResource | Where-Object {$_.Tags -eq $null}
foreach ($resource in $resources) {
    $tags = @{"Environment"="Unknown"}
    Update-AzTag -ResourceId $resource.ResourceId -Tag $tags -Operation Merge
}

Refer to the exhibit. You run this PowerShell script in an Azure subscription. The script executes successfully. What is the outcome?

Question 1mediummultiple choice
Full question →

Exhibit

Refer to the exhibit.

$resources = Get-AzResource | Where-Object {$_.Tags -eq $null}
foreach ($resource in $resources) {
    $tags = @{"Environment"="Unknown"}
    Update-AzTag -ResourceId $resource.ResourceId -Tag $tags -Operation Merge
}

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

All resources without tags get the tag 'Environment' with value 'Unknown'.

The `Update-AzTag` cmdlet with the `-Operation Merge` parameter merges the specified tags into existing resource tags without removing any existing tags. When a resource already has tags, only the specified tag is added or updated; when a resource has no tags, the specified tag is applied. This matches option B: all resources without tags get the tag 'Environment' with value 'Unknown'.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • All existing tags are replaced with 'Environment'='Unknown'.

    Why it's wrong here

    Merge operation adds tags, does not replace existing ones.

  • All resources without tags get the tag 'Environment' with value 'Unknown'.

    Why this is correct

    The script filters resources with no tags and adds the tag via merge.

    Related concept

    Read the scenario before looking for a memorised answer.

  • All resources in the subscription get the tag 'Environment' with value 'Unknown'.

    Why it's wrong here

    The script only processes resources with no tags.

  • The script fails because Update-AzTag does not support merge.

    Why it's wrong here

    Update-AzTag supports -Operation Merge.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often assume `Update-AzTag` with Merge behaves like a full replacement (Option A) or applies to all resources (Option C), when in fact Merge only adds or updates the specified tags and only targets resources that match the resource ID pipeline input — in this case, resources without tags due to the `Where-Object` filter.

Detailed technical explanation

How to think about this question

The `Update-AzTag` cmdlet uses the Azure Resource Manager Tags API, which supports four operations: Merge, Replace, Delete, and Combine. The Merge operation performs a logical 'upsert' — it adds the specified tags to a resource's existing tag set, overwriting values if the key already exists, but never removing other tags. This is critical for incremental tagging scenarios where you want to ensure a baseline tag exists without disturbing existing governance tags.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related AZ-305 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free AZ-305 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this AZ-305 question test?

Design identity, governance, and monitoring solutions — This question tests Design identity, governance, and monitoring solutions — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: All resources without tags get the tag 'Environment' with value 'Unknown'. — The `Update-AzTag` cmdlet with the `-Operation Merge` parameter merges the specified tags into existing resource tags without removing any existing tags. When a resource already has tags, only the specified tag is added or updated; when a resource has no tags, the specified tag is applied. This matches option B: all resources without tags get the tag 'Environment' with value 'Unknown'.

What should I do if I get this AZ-305 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 24, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This AZ-305 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-305 exam.