0
0
Azurecloud~10 mins

Resource locks (delete, read-only) in Azure - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a read-only lock on a resource group in Azure.

Azure
az lock create --name MyReadOnlyLock --lock-type [1] --resource-group MyResourceGroup
Drag options to blanks, or click blank then click option'
AReadOnly
BCanNotDelete
CDelete
DWrite
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'CanNotDelete' instead of 'ReadOnly' for a read-only lock.
Confusing lock types with unrelated terms.
2fill in blank
medium

Complete the code to create a delete lock on a storage account.

Azure
az lock create --name DeleteLock --lock-type [1] --resource-group StorageGroup --resource-name mystorageaccount --resource-type Microsoft.Storage/storageAccounts
Drag options to blanks, or click blank then click option'
AReadOnly
BWrite
CDeleteOnly
DCanNotDelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ReadOnly' which prevents all changes, not just deletion.
Using non-existent lock types like 'DeleteOnly'.
3fill in blank
hard

Fix the error in the command to remove a lock named 'OldLock' from a resource group.

Azure
az lock delete --name [1] --resource-group MyResourceGroup
Drag options to blanks, or click blank then click option'
AMyResourceGroup
BDeleteLock
COldLock
DLockName
Attempts:
3 left
💡 Hint
Common Mistakes
Using the resource group name instead of the lock name.
Using a wrong or generic lock name.
4fill in blank
hard

Fill both blanks to list all locks on a specific resource.

Azure
az lock list --resource-group [1] --resource-name [2] --resource-type Microsoft.Compute/virtualMachines
Drag options to blanks, or click blank then click option'
AMyResourceGroup
BMyVM
CStorageGroup
DMyStorageAccount
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing storage account names with VM names.
Using wrong resource group names.
5fill in blank
hard

Fill all three blanks to create a read-only lock on a specific storage container.

Azure
az lock create --name [1] --lock-type [2] --resource-group [3] --resource-type Microsoft.Storage/storageAccounts/blobServices/containers --resource-name mystorageaccount/default/mycontainer
Drag options to blanks, or click blank then click option'
AContainerReadOnlyLock
BReadOnly
CStorageGroup
DCanNotDelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'CanNotDelete' when a read-only lock is needed.
Incorrect resource group name.