Interview Prep/Azure/Quota, Deployment and IaC Errors

Terraform: `Error: Error acquiring the state lock ... state blob is already locked`.

BeginnerTroubleshootingQuota, Deployment and IaC Errors
Answer

Likely causes → Another run holds the blob lease, or a crashed run left the lease.

Diagnose → The error shows the lock ID, who and when. Check running pipelines.

Fix →

  1. Wait for the other run, or if it's dead: terraform force-unlock <LOCK_ID>
  2. Or break the lease: az storage blob lease break --container-name tfstate --blob-name shop/prod.tfstate --account-name sttfstate --auth-mode login

Prevent → Pipeline concurrency limits per environment.

Azure All Azure questions

More on Quota, Deployment and IaC Errors