Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Configure resource locks

A worked example

Put in order

You are an Azure administrator. Azure CLI is not installed on your new workstation. You must protect the resource group rg-finance and its resources against accidental deletion by using Azure CLI.

Which four actions should you perform in sequence to protect rg-finance from deletion and confirm that the protection exists? Put the required actions in the correct order.

Your order

You didn't answer this one.

Correct order
1Install Azure CLI on the workstation.
2Sign in to Azure CLI with an authenticated account.
3Run az lock create --name LockFinance --lock-type CanNotDelete --resource-group rg-finance.
4Run az lock list --resource-group rg-finance and confirm that LockFinance appears.
Why

Install Azure CLI and sign in before using it to manage the resource group. Create a CanNotDelete lock at resource-group scope to protect the group and its resources from deletion. Then list the locks to confirm that LockFinance exists.

  • Step 1: Install Azure CLI on the workstation. Azure CLI must be installed before you can use it to sign in or manage resource locks.
  • Step 2: Sign in to Azure CLI with an authenticated account. The resource-management commands require an authenticated session.
  • Step 3: Run az lock create --name LockFinance --lock-type CanNotDelete --resource-group rg-finance. A CanNotDelete lock on the resource group blocks deletion of the group and its resources.
  • Step 4: Run az lock list --resource-group rg-finance and confirm that LockFinance appears. Listing the locks verifies that the protection exists after creation.
  • Not needed: Run az group delete --name rg-finance to prove that the lock blocks deletion. A deletion attempt is unnecessary to confirm that the lock exists and could delete the group if protection were absent.
  • Not needed: Run az lock delete --name LockFinance --resource-group rg-finance. This removes the deletion protection you need to retain.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free