Your goal
Move the current sandbox state into the assigned backend key without recreating, importing, or changing the managed identity.
Exercise 8 ยท 50 minutes
Inspect what local state records, migrate it to the organization-provided Azure Storage backend, and verify that the same resource remains under management.
Before you start
Move the current sandbox state into the assigned backend key without recreating, importing, or changing the managed identity.
Participant task
Use Terraform commands to list managed addresses and inspect the current identity. Do not open or commit the raw state file.
terraform state list
terraform state show <identity-resource-address>Record who owns the storage account, which state key belongs to your team, how authentication works, and what network path reaches Blob storage.
Add an empty backend "azurerm" {} block. Supply the organization-provided values to terraform init -migrate-state through the approved local mechanism and use Entra authentication.
terraform init -migrate-stateList state again and create a saved plan. The resource address and Azure resource ID must be unchanged, and the plan should report no infrastructure changes.
terraform state list
terraform plan -out main.tfplanDescribe what happens when authentication succeeds but Blob data-plane RBAC, private routing, DNS, or the state lease does not.
Expected outcome
With an instructor, observe a state lock and identify the lease rather than using force-unlock. Discuss when force-unlock is justified.
Finish
Commit only the empty backend declaration and related documentation. Retain the sandbox for Exercise 10.