Exercise - Apply cost-tracking tags
This guided project consists of the following exercises:
- Apply cost-tracking tags
- Create budget and alerts
- Assign and test Azure Policy
In this exercise, you create a resource group and storage account, then apply organizational tags to both. Tags are the foundation of cost governance—they let you categorize resources by team, environment, or project so you can track spending accurately.
This exercise includes the following tasks:
- Prepare the environment
- Create a test storage account
- Tag the resource group
- Tag the storage account
Outcome: Tagged pilot resources ready for cost reporting and filtering.
Tip
Pause after each major action and confirm the page status before moving on. This habit prevents compounding mistakes.
Task 1: Prepare the environment
Set up your Azure environment before you begin. You create a resource group and a test resource as a pilot scope for governance controls.
Warning
This project creates Azure resources that may incur charges. Complete the clean-up unit when you're done to avoid unintended expenses.
- Sign in to the Azure portal with an account that has permissions to create budgets and policy assignments.
- In the portal search bar, search for Resource groups and select Resource groups.
- Select + Create.
- For Name, enter rg-gp-cost-guardrails.
- For Region, choose your preferred region.
- Select Review + create and then select Create.
- Note the email address you want to use for budget alert notifications.
Task 2: Create a test storage account
Create a storage account inside the resource group. This gives you a resource to tag and a scope for policy testing.
- In the portal search bar, search for Storage accounts and select Storage accounts.
- Select + Create.
- On the Basics tab, select rg-gp-cost-guardrails as the resource group.
- For Storage account name, enter a globally unique name (for example, stgpcostguard followed by your initials and a number).
- For Region, use the same region as the resource group.
- For Preferred Storage Type, select Azure Blob Storage or Azure Data Lake Storage Gen 2.
- For Performance, select Standard.
- For Redundancy, select Locally-redundant storage (LRS).
- Select Review + create and then select Create.
- When deployment finishes, select Go to resource.
Task 3: Tag the resource group
Apply organizational tags to your resource group. Tags are key-value pairs that help you categorize resources, track costs, and enforce policies at scale.
- In the portal search bar, search for Resource groups and select Resource groups.
- Select rg-gp-cost-guardrails from the list.
- In the left menu, select Tags.
- Add the tag environment with the value pilot.
- Add the tag owner with the value it-team.
- Select Apply.
Note
Validation step: Confirm the resource group displays both tags (environment: pilot and owner: it-team).
Note
Each exercise includes validation steps like this one. Track your results as you go—you'll review them all in the validation unit at the end of this module.
Task 4: Tag the storage account
Apply the same tags to your test resource. Resource-level tags ensure consistent tagging across all assets, enabling accurate cost allocation and governance reporting.
- In the portal search bar, search for Storage accounts and select Storage accounts.
- Select the storage account you created (for example, stgpcostguard).
- In the left menu, select Tags.
- Add the tag environment with the value pilot.
- Add the tag owner with the value it-team.
- Select Apply.
Note
Validation step: Confirm the storage account also displays both tags, matching the resource group.