Interview Prep/Azure/Fundamentals and Resource Hierarchy

What are resource locks and what are their gotchas?

IntermediateConceptFundamentals and Resource Hierarchy
Answer

Locks protect against deletion or modification regardless of RBAC. Two levels: CanNotDelete and ReadOnly. They inherit downward.

Gotchas:

  • ReadOnly on a storage account blocks listKeys, which breaks anything using account keys.
  • ReadOnly on an AKS RG or the node RG breaks scaling and upgrades.
  • A lock on an RG blocks terraform destroy with ScopeLocked.
az lock create -n no-delete -g rg-shop-prod --lock-type CanNotDelete
az lock list -g rg-shop-prod -o table

We use CanNotDelete on prod data stores and shared networking, and almost never ReadOnly.

Azure All Azure questions Roadmap: Azure core services

More on Fundamentals and Resource Hierarchy