AZ-104 Manage Azure Identities and Governance Practice Question
During a change freeze, administrators must prevent deletion of a production resource group and all resources inside it, but they still need to update VM sizes and tags. Which lock should be applied?
⚠ Common exam trap
Watch out — candidates often confuse CanNotDelete with ReadOnly, assuming that any lock will block updates, but CanNotDelete specifically allows modifications while only preventing 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
✓
CanNotDelete on the resource group
The CanNotDelete lock on the resource group prevents deletion of the resource group and all resources within it, while still allowing read and update operations such as modifying VM sizes and tags. This meets the requirement of blocking deletions during the change freeze without restricting updates. ReadOnly locks would block all write operations, including the needed 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.
- ✗
ReadOnly on the resource group
Why it's wrong here
ReadOnly on the resource group is too restrictive for this need. An Azure resource lock set to ReadOnly blocks all write and delete operations, meaning administrators could not resize a VM, update tags, or make any configuration changes during the freeze. The scenario requires protecting against deletion while still allowing updates, so CanNotDelete is the precise lock type because it only blocks deletion without interfering with legitimate modifications.
When this WOULD be correct
If the requirement were to prevent any changes (including updates) to the resource group and its resources, while still allowing read access, a ReadOnly lock would be correct.
- ✓
CanNotDelete on the resource group
Why this is correct
CanNotDelete is the correct lock when you want to stop accidental deletion but still allow configuration changes. Applied at the resource group scope, it protects the group and the resources inside it from being deleted while still permitting updates such as resizing a VM or changing tags. That makes it ideal for a maintenance freeze.
- ✗
CanNotDelete on the management group
Why it's wrong here
Placing CanNotDelete on the management group is an overbroad action for this scenario. A management group lock cascades to all subscriptions, resource groups, and resources under that management group, which could include many unrelated production or test environments beyond the single resource group in question. This would unnecessarily restrict deletion across a large scope, whereas applying CanNotDelete directly to the target resource group confines the protection to that group and its children without affecting other resources.
When this WOULD be correct
A question where the requirement is to prevent deletion of all resource groups within a management group (e.g., all production subscriptions) while still allowing updates to resources inside them. For example: 'You need to ensure that no resource groups can be deleted in the production management group, but administrators can still modify resources. Which lock should you apply?'
- ✗
An Azure Policy deny assignment
Why it's wrong here
An Azure Policy deny assignment is the wrong mechanism because policies enforce compliance rules on resource properties and configurations, not on lifecycle operations like resource group deletion. Policy can prevent the creation of non-compliant resources or deny updates that violate a rule, but it does not act as a lock to block a delete request at the resource group scope. Deletion can only be blocked through a resource lock or a deny action on the specific delete operation, which requires a custom role assignment rather than a policy.
When this WOULD be correct
If the question required preventing any changes to resources (including updates to VM sizes and tags) while still allowing reads, a deny assignment or ReadOnly lock would be correct.
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.
✓CanNotDelete on the resource groupCorrect answer▾
Why this is correct
CanNotDelete is the correct lock when you want to stop accidental deletion but still allow configuration changes. Applied at the resource group scope, it protects the group and the resources inside it from being deleted while still permitting updates such as resizing a VM or changing tags. That makes it ideal for a maintenance freeze.
✗ReadOnly on the resource groupWrong answer — click to see why▾
Why this is wrong here
ReadOnly lock prevents all write operations, including updating VM sizes and tags, which contradicts the requirement to allow those updates.
★ When this WOULD be the correct answer
If the requirement were to prevent any changes (including updates) to the resource group and its resources, while still allowing read access, a ReadOnly lock would be correct.
Why candidates choose this
Candidates may confuse 'prevent deletion' with 'prevent changes', assuming ReadOnly is needed to block deletions, but ReadOnly is more restrictive than necessary.
✗CanNotDelete on the management groupWrong answer — click to see why▾
Why this is wrong here
Applying CanNotDelete on the management group would block deletion of all resource groups under that management group, but the question only requires preventing deletion of a single production resource group. Additionally, it does not address the need to allow updates to VM sizes and tags, which is already permitted with CanNotDelete at the resource group level.
★ When this WOULD be the correct answer
A question where the requirement is to prevent deletion of all resource groups within a management group (e.g., all production subscriptions) while still allowing updates to resources inside them. For example: 'You need to ensure that no resource groups can be deleted in the production management group, but administrators can still modify resources. Which lock should you apply?'
Why candidates choose this
Candidates may think that applying the lock at a higher scope (management group) is more efficient or provides broader protection, overlooking that the question specifies a single resource group and that the lock at the management group would affect all child resource groups, which is not required.
✗An Azure Policy deny assignmentWrong answer — click to see why▾
Why this is wrong here
An Azure Policy deny assignment can block updates to VM sizes and tags, which contradicts the requirement that administrators still need to update those properties.
★ When this WOULD be the correct answer
If the question required preventing any changes to resources (including updates to VM sizes and tags) while still allowing reads, a deny assignment or ReadOnly lock would be correct.
Why candidates choose this
Candidates may think a deny assignment provides more granular control, but it would overly restrict the required update operations.
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?”
Go deeper
Related to this question
Learn chapter
Managed Identities for Azure Resources
Key term
Group
A group is a collection of users, devices, or other objects that are assigned permissions and policies together for simplified management in identity and governance systems like Microsoft Entra ID.
Key term
Resource group
A logical container in Microsoft Azure that holds related resources for an application or solution, enabling unified management, security, and billing.
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 →
Same concept, more angles
1 more way this is tested on AZ-104
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A production resource group contains web and data resources. Administrators must be able to update, scale, and restart resources, but they must not delete the resource group or any resource inside it during maintenance windows. Which two actions should the administrator take? Select two.
medium- ✓ A.Apply a CanNotDelete lock to the resource group.
- B.Apply a ReadOnly lock to the resource group.
- C.Apply a CanNotDelete lock only to the individual virtual machines.
- ✓ D.Apply the lock at the resource group scope so it covers child resources.
- E.Use tags to mark the resources as production and prevent deletion.
Why A: Applying a CanNotDelete lock to the resource group prevents the deletion of the resource group and all resources within it, while still allowing administrators to update, scale, and restart resources. This lock type blocks delete operations but permits read and update operations, which aligns with the requirement to perform maintenance actions without risking deletion. The lock is inherited by all child resources in the resource group, ensuring comprehensive protection.
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.