# The Azure budget missing a resource group

A real Azure subscription budget is intended to track two isolated lab
resource groups, but its filter includes only one. Investigate the filter and
correct it without expanding the budget to unrelated resources or changing
other budgets.

## Before you begin

Use an isolated Azure subscription and a private Linux filesystem with Bash,
Python 3, Terraform 1.5+ and Azure CLI. Sign in and select the intended
subscription. Your identity needs permission to manage resource groups, action
groups and subscription budgets. `Microsoft.Resources`, `Microsoft.Insights`
and `Microsoft.Consumption` must already be registered.

Setup creates two uniquely named resource groups, an action group without
receivers, and a subscription budget filtered to the lab groups. The action
group and budget notification are disabled; the budget is not a spending cap
and does not stop resources. Review Azure pricing: cloud operations or
resources may incur charges. Do not add other resources to either group.

The budget amount is in the subscription billing currency. The exercise
examines the actual Azure filter only; it does not generate spending, test cost
ingestion or trigger an actual budget notification. Azure cost data can be
delayed. Do not change existing budgets or cost guards.

## Investigate

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

Inspect the two lab group names and the budget filter. Update the Terraform
input in `.lab-state/scope.auto.tfvars.json`, then use the guarded plan and
apply commands:

```sh
./lab.sh plan
./lab.sh apply
./verify.sh
./teardown.sh
```

The guarded apply permits only an in-place update of the lab budget. Teardown
checks resource identities and group contents before destroying only lab
resources with Terraform. If setup or teardown fails, preserve `.lab-state`
and inspect Azure before retrying. After teardown, confirm the resources are
gone before removing private state. Never reuse this lab's groups for real
resources.
