Question 31
Your company purchases a new Azure subscription.
You create a file named Deploy json as shown in the following exhibit
You create a file named Deploy json as shown in the following exhibit


Explanation:
This question tests understanding of Azure Resource Manager (ARM) templates, deployment scopes, and resource locks. The template performs a subscription-level deployment that creates three resource groups (RG1, RG2, RG3) and applies different resource locks - RG1 gets a CanNotDelete lock, RG2 gets a ReadOnly lock, and RG3 has no lock applied. Understanding how these locks affect resource deployment and management is critical.
Correct Option Analysis:
Statement 1: "You can deploy a virtual machine to RG1."
Answer: Yes
RG1 has a CanNotDelete lock applied, which prevents deletion of resources but allows modifications and new deployments. This lock type still permits creating and managing resources within the resource group. Therefore, deploying a virtual machine to RG1 is allowed because the lock only restricts delete operations, not create or update operations.
Statement 2: "You can deploy a virtual machine to RG2."
Answer: No
RG2 has a ReadOnly lock applied, which prevents any modifications to resources within the resource group. This lock type blocks all create, update, and delete operations. Users can only read existing resources. Therefore, deploying a virtual machine (which is a create operation) to RG2 is not allowed while the ReadOnly lock is in place.
Statement 3: "You can manually create a resource group named RG3."
Answer: No
The template already creates three resource groups named RG1, RG2, and RG3 through the copy loop with count set to 3. Since RG3 is created by the template deployment, attempting to manually create another resource group with the same name would fail because resource group names must be unique within a subscription. The template creates RG3, so you cannot manually create another RG3.
Reference:
Azure Resource Manager locks and their effects
Subscription-level ARM template deployments
Resource group name uniqueness requirements









