Exercise - Create resources and apply tags
This guided project consists of the following exercises:
- Create resources and apply tags
- Apply resource locks
- Test lock enforcement
In this exercise, you create a resource group with two storage accounts and apply organizational tags to each one. You then use tag-based filtering to see how tags help you find and organize resources across a growing environment.
This exercise includes the following tasks:
- Prepare the environment
- Create a test storage account
- Tag the resource group
- Tag the storage account
- Create a second storage account with different tags
- Filter resources by tag
Outcome: A resource group and storage account with consistent organizational tags applied.
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 to practice tagging and locking.
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 and manage resources.
- In the portal search bar, search for Resource groups and select Resource groups.
- Select + Create. Name the resource group rg-gp-tags-locks, choose your preferred region, and select Review + create then Create.
Task 2: Create a test storage account
Create a low-cost storage account inside the resource group. This gives you a resource to tag and lock in the following exercises.
- In the portal search bar, search for Storage accounts and select Storage accounts.
- Select + Create.
- On the Basics tab, select rg-gp-tags-locks as the resource group.
- For Storage account name, enter a globally unique name (for example, stgptagslock 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 the resource group. Tags are key-value pairs that help you categorize resources, track costs by department or project, and enforce governance policies.
- In the portal search bar, search for Resource groups and select Resource groups.
- Select rg-gp-tags-locks from the list.
- In the left menu, select Tags.
- Add the tag department with the value development.
- Add the tag environment with the value test.
- Select Apply.
- Confirm both tags appear in the tags list.
Note
Validation step: Verify the resource group displays both tags (department: development and environment: test) before proceeding.
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 the storage account. Tagging resources individually ensures accurate cost reporting even when multiple teams share a resource group.
- Open the storage account you created.
- In the left menu, select Tags.
- Add the tag department with the value development.
- Add the tag environment with the value test.
- Select Apply.
Note
Validation step: Confirm the storage account now shows both tags matching the resource group tags.
Task 5: Create a second storage account with different tags
Create another resource and assign different tag values. Having resources with different tags demonstrates how tags enable filtering and cost allocation across teams.
- In the portal search bar, search for Storage accounts and select Storage accounts.
- Select + Create.
- On the Basics tab, select rg-gp-tags-locks as the resource group.
- For Storage account name, enter a globally unique name (for example, stgptagsops 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.
- In the left menu, select Tags.
- Add the tag department with the value operations.
- Add the tag environment with the value test.
- Select Apply.
Note
Validation step: Verify the second storage account exists with department: operations and environment: test tags.
Task 6: Filter resources by tag
Use tags to filter the resource list and see only the resources that belong to a specific department. This demonstrates the practical value of consistent tagging for managing resources at scale.
- In the portal search bar, search for Resource groups and select Resource groups.
- Select rg-gp-tags-locks from the list.
- In the resource list, select Add filter.
- In the Filter dropdown, scroll down to Tags and select the department tag.
- In the Operator dropdown, select Equals.
- Select the checkbox next to development and select Apply.
- Confirm that only the stgptagslock storage account appears in the filtered list.
- Select the X on the right side of the filter to clear it, then repeat the steps above but select the checkbox next to operations instead.
- Confirm only the stgptagsops storage account appears.
- Select the X on the right side of the filter to clear it and show all resources again.
Note
Validation step: Confirm filtering by department tag shows only the correct storage account for each department value.