Prepare and test your skills

Prepare and test your skills

Free sample question, answered and explained below. The AZ-900 Microsoft Azure Fundamentals Exam practice bank has 688 more like it. Try 10 free: instant score, no account.
An IT administrator is managing a critical storage account named corpdata in a resource group named rg-production.
The team must be able to continue updating the storage account's configuration and accessing data, but the organization wants to prevent any user from accidentally deleting the storage account.
Which Azure PowerShell command should the administrator execute to apply the appropriate resource lock?
This command uses New-AzResourceLock with the -LockLevel ReadOnly parameter to apply a read-only lock to the corpdata storage account.
While a ReadOnly lock prevents deletion, it also restricts all modification operations on the resource. The scenario explicitly requires that team members remain able to update configurations. Under a ReadOnly lock, configuration changes and management-plane write operations are blocked. Furthermore, on storage accounts, a ReadOnly lock blocks API calls such as List Keys, which can disrupt management portal operations.
List Keys used by management tools to retrieve account keys.The organization wanted an immutable archive storage resource where neither deletions nor configuration modifications were permitted.
Always choose CanNotDelete when existing configuration pipelines or routine updates must continue unimpeded, reserving ReadOnly for static or frozen environments.
The New-AzResourceLock cmdlet creates an Azure Resource Manager lock on a designated Azure resource, resource group, or subscription. Azure supports two resource lock levels: CanNotDelete and ReadOnly.
-LockLevel CanNotDelete ensures that authorized users can read and modify the resource's configuration while strictly blocking any operation that deletes the resource.corpdata storage account without encountering authorization errors.-ResourceName "corpdata" along with -ResourceType "Microsoft.Storage/storageAccounts", the lock is scoped directly to the storage account rather than locking every item in the parent resource group.This command precisely implements a CanNotDelete lock on the specific storage account, satisfying both constraints: safeguarding the resource against deletion while permitting normal day-to-day administrative changes.
The Remove-AzResourceLock cmdlet is used to delete or remove an existing Azure Resource Manager lock from an Azure resource, resource group, or subscription.
This command removes a lock rather than creating one. If executed, it would delete protection instead of applying the needed guardrail to protect corpdata from accidental deletion.
An existing lock on the storage account needed to be decommissioned so that an administrator could permanently delete the resource.
To manage lock lifecycles with Azure PowerShell, administrators use New-AzResourceLock for creation, Get-AzResourceLock for viewing, and Remove-AzResourceLock for removal.
This command applies a CanNotDelete lock at the resource group level to rg-production rather than directly to the specific storage account.
Applying a lock at the resource group level impacts all resources within that resource group due to lock inheritance. All child resources inherit the parent lock, which would restrict the deletion of every other resource inside rg-production. The requirement was specifically to protect the individual corpdata storage account.
rg-production from being deleted, which may interfere with other workloads.-ResourceName and -ResourceType, meaning the lock attaches to the group container itself.The objective was to protect every resource contained within the rg-production resource group from being deleted in a single administrative operation.
Lock inheritance flows from top to bottom: Subscription → Resource Group → Resource. When restricting an individual workload without affecting neighboring services, apply the lock at the resource level.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated