# Restore an Azure Blob snapshot

This exercise provisions a uniquely named Azure resource group, storage
account and private blob container with Terraform. It uploads a small synthetic
dataset, takes a real Azure Blob snapshot, then overwrites the current blob.
Investigate and restore the original into a separate local directory; do not
overwrite the source blob.

Azure Storage and transactions can incur charges. Use an isolated subscription
with known safe guardrails and clean up promptly. The storage endpoint is
publicly reachable using account credentials, but anonymous blob access is
disabled. The account key, Terraform state and restored data are sensitive;
use a private Linux filesystem and never publish them. Do not add other blobs,
snapshots or containers: teardown refuses unexpected resources or data.

Install Azure CLI, Terraform 1.5+, Python 3 and Bash on Linux. Log in and select
the intended subscription. `Microsoft.Resources` and `Microsoft.Storage` must
already be registered, and your identity must be able to read storage account
keys. The Blob endpoint must be reachable.

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

Inspect the current data and snapshot, then use the lab commands to download a
snapshot into the clean private restore directory. Run `./verify.sh` and
`./teardown.sh`. Verification compares recovered data with the original and
checks that the overwritten source was not changed. Teardown destroys the lab
blob, snapshot, container, account and group after checking their identities
and contents; confirm the group is absent before removing `.lab-state`.
