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.
You didn't answer this one.
az lock create --name LockFinance --lock-type CanNotDelete --resource-group rg-finance.az lock list --resource-group rg-finance and confirm that LockFinance appears.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-financeand confirm that LockFinance appears. Listing the locks verifies that the protection exists after creation. - Not needed: Run
az group delete --name rg-financeto 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.
- Manage Resource Groups - Azure CLI - Azure Resource ManagerMicrosoft Learn