Your company has an Azure subscription that includes two virtual machines, named VirMac1 and VirMac2, which both have a status of Stopped (Deallocated).
The virtual machines belong to different resource groups, named ResGroup1 and ResGroup2.
You have also created two Azure policies that are both configured with the virtualMachines resource type. The policy configured for ResGroup1 has a policy definition of Not allowed resource types, while the policy configured for ResGroup2 has a policy definition of Allowed resource types.
You then create a Read-only resource lock on VirMac1, as well as a Read-only resource lock on ResGroup2.
Which of the following is TRUE with regards to the scenario? (Choose all that apply.)
A. You will be able to start VirMac1.
B. You will NOT be able to start VirMac1.
C. You will be able to create a virtual machine in ResGroup2.
D. You will NOT be able to create a virtual machine in ResGroup2.
answer: BD
✅ Explanation:
-Scenario Recap:
-Two VMs: VirMac1 in ResGroup1 and VirMac2 in ResGroup2, both Stopped (Deallocated).
-Two Azure policies:
-On ResGroup1: Policy with Not allowed resource types (blocking some resource types).
-On ResGroup2: Policy with Allowed resource types (allowing only certain resource types).
-Locks applied:
Read-only lock on VirMac1.
Read-only lock on ResGroup2.
-Key Concepts:
Read-only lock: Prevents any modification or deletion of the resource or resource group.
-Policy with Not allowed resource types: Prevents creation or update of disallowed resource types.
-Policy with Allowed resource types: Only permits creation/update of allowed resource types; all others are blocked.
Analyzing each option:
A. You will be able to start VirMac1.
VirMac1 has a Read-only lock.
-Starting (powering on) a VM is a modification operation.
-Read-only locks prevent any modification.
-Therefore, starting VirMac1 will NOT be allowed.
A is FALSE
B. You will NOT be able to start VirMac1.
As explained, the Read-only lock on VirMac1 prevents starting the VM.
This statement is TRUE.
C. You will be able to create a virtual machine in ResGroup2.
ResGroup2 has:
An Allowed resource types policy that restricts what resource types can be created.
A Read-only lock at the resource group level.
Read-only lock on a resource group prevents any create, update, or delete operation on resources in that group.
Therefore, creating a VM in ResGroup2 is NOT allowed.
C is FALSE
D. You will NOT be able to create a virtual machine in ResGroup2.
Based on the above, due to the Read-only lock on ResGroup2, creation of VMs is blocked.
-The Allowed resource types policy could permit VM creation in theory, but the lock overrides this.