Soru

Zorluk: OrtaResource Locks

An Azure subscription contains a resource group named RG1. RG1 contains a virtual machine named VM1. A CanNotDelete lock is applied to the subscription, and a ReadOnly lock is applied to RG1. Which of the following describes the effective restrictions on VM1?

  1. VM1 cannot be modified and cannot be deleted.Cevap
  2. B
    VM1 can be modified but cannot be deleted.
  3. C
    VM1 can be modified and deleted.
  4. D
    VM1 can be deleted but cannot be modified.

Cevap

VM1 cannot be modified and cannot be deleted.
The correct option is that the virtual machine cannot be modified and cannot be deleted. Azure resource locks are inherited by all resources in the scope. When multiple locks are applied, the most restrictive lock applies. A ReadOnly lock is more restrictive than a CanNotDelete lock, meaning that the virtual machine inherits the ReadOnly lock from its resource group, which blocks both configuration changes (modifications) and deletion.

Adım Adım Çözüm

1
Evaluate the inheritance of resource locks from parent scopes.
The CanNotDelete lock from the subscription and the ReadOnly lock from the resource group (RG1) both inherit down to the virtual machine (VM1).
Azure resource locks are inherited by all resources within the scope of the parent where they are applied.
2
Determine the effective lock by applying the rule of the most restrictive lock.
The ReadOnly lock is more restrictive than the CanNotDelete lock, so the effective lock on VM1 is ReadOnly.
When multiple locks are applied at different scopes, the most restrictive lock takes precedence and applies to the resource.
3
Identify the operations blocked by the effective ReadOnly lock.
Both modifications (write operations) and deletions are blocked on VM1.
A ReadOnly lock prevents users from deleting or modifying a resource, whereas a CanNotDelete lock only prevents deletion but allows modifications.

Anahtar Kavram

Azure resource locks inheritance and precedence rules, specifically how ReadOnly and CanNotDelete locks interact when applied at different scopes.
Bu soruyu puanla