Courseiva
Manage Azure Identities and GovernancemediumMultiple ChoiceObjective-mapped

AZ-104 Manage Azure Identities and Governance Practice Question

Exhibit

Change-freeze requirement:
- Prevent accidental deletion of RG-Prod
- Allow normal configuration changes inside the resource group
- VM resize operations must still work
Current lock state:
- No locks are configured

Based on the exhibit, the production resource group must not be deleted during a change freeze, but administrators still need to update VM sizes and tag values. Which lock should you apply?

⚠ Common exam trap

A common mix-up: candidates confuse ReadOnly locks with CanNotDelete locks, assuming that any lock will prevent updates, when in fact ReadOnly locks block all write operations while CanNotDelete locks only block deletion.

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

Apply a CanNotDelete lock to RG-Prod.

A CanNotDelete lock (B) prevents deletion of the resource group while allowing all other operations, including updating VM sizes and modifying tag values. This meets the requirement of blocking deletion during a change freeze without restricting administrative updates.

Answer analysis

Option-by-option breakdown

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

  • Apply a ReadOnly lock to RG-Prod.

    Why it's wrong here

    A ReadOnly lock is too restrictive for this freeze scenario. It does prevent deletion of RG-Prod, but it also blocks any write operation, including VM resizing, tag updates, and creating new resources, because all modifications are considered write operations. Since the stated requirement is to allow approved changes while only preventing deletion, a ReadOnly lock would freeze functionality and is therefore the wrong control.

    When this WOULD be correct

    Apply a ReadOnly lock when the requirement is to prevent any modifications to resources, such as during a security audit or to enforce a strict read-only state for compliance, while still allowing read access.

  • Apply a CanNotDelete lock to RG-Prod.

    Why this is correct

    A CanNotDelete lock is the ideal choice because it specifically blocks deletion of the resource group and all contained resources while permitting every read and write operation, such as resizing VMs and updating tags. This directly satisfies the freeze mandate to prevent accidental removal without hindering routine management activities. The lock is also scoped and can only be removed by users with sufficient permissions, providing a strong, secure safeguard.

  • Apply a lock to the subscription instead of the resource group.

    Why it's wrong here

    Applying the lock at the subscription scope expands the deletion protection far beyond RG-Prod, affecting every resource group and resource in the subscription. This creates a broad blast radius that could interfere with unrelated teams and workloads, preventing them from deleting resources in their own scopes and breaking their operational processes. A resource-group lock is the correct level of scoping to adhere to least privilege and minimize unintended impact.

    When this WOULD be correct

    If the requirement were to prevent deletion of all resource groups in the subscription during a change freeze, while still allowing updates to resources, a subscription-level CanNotDelete lock would be correct.

  • Use Azure Policy with a deny effect to block deletes.

    Why it's wrong here

    Azure Policy with a deny effect cannot reliably block deletion of existing resources. Policy evaluation occurs during resource creation and update operations, not at the time of a delete request, and there is no built-in policy effect for denying deletes. Even custom definitions cannot intercept management-plane delete actions in the way a resource lock does. Therefore, a lock is the native and purpose-built control for this freeze scenario, not policy.

    When this WOULD be correct

    An exam scenario where you need to prevent deletion of specific resource types (e.g., storage accounts) across multiple resource groups, but still allow deletion of other resources. For example: 'You need to ensure that no storage accounts can be deleted in any resource group, but administrators can still delete other resources. What should you use?'

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-104 exam frequently reuses these exact scenarios with slightly different constraints.

Apply a CanNotDelete lock to RG-Prod.Correct answer

Why this is correct

A CanNotDelete lock is the ideal choice because it specifically blocks deletion of the resource group and all contained resources while permitting every read and write operation, such as resizing VMs and updating tags. This directly satisfies the freeze mandate to prevent accidental removal without hindering routine management activities. The lock is also scoped and can only be removed by users with sufficient permissions, providing a strong, secure safeguard.

Apply a ReadOnly lock to RG-Prod.Wrong answer — click to see why

Why this is wrong here

A ReadOnly lock prevents all write operations, including updating VM sizes and tag values, which the question requires administrators to be able to do.

★ When this WOULD be the correct answer

Apply a ReadOnly lock when the requirement is to prevent any modifications to resources, such as during a security audit or to enforce a strict read-only state for compliance, while still allowing read access.

Why candidates choose this

Candidates may think a ReadOnly lock is sufficient to prevent deletion, but they overlook that it also blocks updates, which are explicitly needed in this scenario.

Apply a lock to the subscription instead of the resource group.Wrong answer — click to see why

Why this is wrong here

Applying a lock to the subscription would prevent deletion of all resource groups in the subscription, including non-production ones, which is too restrictive and not required by the scenario that only targets the production resource group.

★ When this WOULD be the correct answer

If the requirement were to prevent deletion of all resource groups in the subscription during a change freeze, while still allowing updates to resources, a subscription-level CanNotDelete lock would be correct.

Why candidates choose this

Candidates may think a subscription lock provides broader protection and is simpler to manage, overlooking that it affects all resource groups and may violate the principle of least privilege.

Use Azure Policy with a deny effect to block deletes.Wrong answer — click to see why

Why this is wrong here

Azure Policy with a deny effect can block delete operations, but it is not a lock and does not prevent deletion of the resource group itself; it only enforces rules on resources within the group. The question specifically requires a lock that prevents deletion while allowing updates to VM sizes and tags, which is exactly what a CanNotDelete lock does.

★ When this WOULD be the correct answer

An exam scenario where you need to prevent deletion of specific resource types (e.g., storage accounts) across multiple resource groups, but still allow deletion of other resources. For example: 'You need to ensure that no storage accounts can be deleted in any resource group, but administrators can still delete other resources. What should you use?'

Why candidates choose this

Candidates may confuse Azure Policy with locks, thinking that a deny effect can replace resource locks. They might also believe that Policy is a more flexible way to block deletions, not realizing that locks are simpler and directly prevent resource group deletion.

Analysis generated from the official AZ-104blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

About these practice questions

One of 1,049 original AZ-104 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-104 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-104 exam.