FinOps Observer
← All labs

Azure cost controls / Intermediate / 25–40 min

The Azure budget missing a resource group

A real Azure budget filters out one of its two lab resource groups. Investigate and correct the filter without widening it beyond the lab.

LAB IDfinops-02-azure-budget-scopeTRACK / finops.observer
Analyst viewing cloud cost charts beside a server rack

The scenario

A subscription budget is intended to track two isolated lab resource groups, but its filter includes only one. Inspect the Azure budget and repair its scope without altering other budgets or resources.

Mission objectives

  • Inspect the real budget and its resource-group filter.
  • Update the lab's Terraform input so both lab groups are included.
  • Verify the Azure filter and remove only the lab resources.

Lab README

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

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:

./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.

View Markdown source ↗

Get the lab

Download and inspect the installer before running it. It checks the archive's SHA-256 digest and refuses to overwrite an existing lab directory.

curl -fsSLO https://devops.download/labs/finops-02-azure-budget-scope.sh
less finops-02-azure-budget-scope.sh
bash finops-02-azure-budget-scope.sh
cd labs/finops-02-azure-budget-scope
./setup.sh "$AZURE_SUBSCRIPTION_ID" northeurope --accept-costs

When you've made your changes, run ./verify.sh. Remove lab resources with ./teardown.sh.

Download the archive instead ↗

Need a nudge?

Hint #1

Compare the budget's ResourceGroupName filter with both lab resource-group names.

Hint #2

The input controlling the filter is in .lab-state/scope.auto.tfvars.json. Review the guarded plan before applying it.

Hint #3 · Related guide on opsbreakfix.com

Read the related guide ↗

Solved it?

Explore the related guide on opsbreakfix.com.

Continue to opsbreakfix.com ↗

One ecosystem.
Many perspectives.

Follow the connection from a hands-on lab to the knowledge and tools behind it.