# Azure Terraform import

This lab creates a real, uniquely named Azure resource group with Terraform,
then removes it from local Terraform state without deleting it. An empty
resource group normally has no direct charge, but Azure services and billing
policies vary. Do not add resources to the group; unexpected contents block
teardown. Use a disposable subscription with known safe guardrails.

Install Azure CLI, Terraform 1.5+, Python 3 and Bash on Linux. Log in and select
the intended subscription. `Microsoft.Resources` must already be registered.

```sh
export AZURE_SUBSCRIPTION_ID="your-subscription-id"
./setup.sh "$AZURE_SUBSCRIPTION_ID" northeurope --accept-costs
```

Terraform's state and backups are private. Run from a private Linux filesystem,
not a shared or world-readable mount. Setup refuses to overwrite an existing
`.lab-state`; preserve it if setup fails. Review plans before applying them.
Never import a real resource into a second active Terraform state.

```sh
terraform -chdir=.lab-state plan -input=false
./verify.sh
./teardown.sh
```

Teardown checks the generated name, ownership tag, Azure contents and Terraform
state before importing a missing lab resource into the state and destroying
it. It refuses to delete a group with resources in it. It keeps local state
afterward; remove `.lab-state` only after independently confirming cleanup.
