Complete the code to create a read-only lock on a resource group in Azure.
az lock create --name MyReadOnlyLock --lock-type [1] --resource-group MyResourceGroupThe ReadOnly lock type prevents any changes to the resource, allowing only read operations.
Complete the code to create a delete lock on a storage account.
az lock create --name DeleteLock --lock-type [1] --resource-group StorageGroup --resource-name mystorageaccount --resource-type Microsoft.Storage/storageAccountsThe CanNotDelete lock type prevents deletion but allows modifications to the resource.
Fix the error in the command to remove a lock named 'OldLock' from a resource group.
az lock delete --name [1] --resource-group MyResourceGroupThe --name parameter requires the exact lock name to delete it. 'OldLock' is the correct lock name here.
Fill both blanks to list all locks on a specific resource.
az lock list --resource-group [1] --resource-name [2] --resource-type Microsoft.Compute/virtualMachines
To list locks on a virtual machine, specify the resource group and the VM name correctly.
Fill all three blanks to create a read-only lock on a specific storage container.
az lock create --name [1] --lock-type [2] --resource-group [3] --resource-type Microsoft.Storage/storageAccounts/blobServices/containers --resource-name mystorageaccount/default/mycontainer
Use a descriptive lock name, the 'ReadOnly' lock type, and the correct resource group to protect the storage container.