|
| 1 | +This guided project consists of the following exercises: |
| 2 | + |
| 3 | + - **Create resources and apply tags** |
| 4 | + - Apply resource locks |
| 5 | + - Test lock enforcement |
| 6 | + |
| 7 | +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. |
| 8 | + |
| 9 | +This exercise includes the following tasks: |
| 10 | + |
| 11 | + - Prepare the environment |
| 12 | + - Create a test storage account |
| 13 | + - Tag the resource group |
| 14 | + - Tag the storage account |
| 15 | + - Create a second storage account with different tags |
| 16 | + - Filter resources by tag |
| 17 | + |
| 18 | +**Outcome:** A resource group and storage account with consistent organizational tags applied. |
| 19 | + |
| 20 | +> [!TIP] |
| 21 | +> Pause after each major action and confirm the page status before moving on. This habit prevents compounding mistakes. |
| 22 | +
|
| 23 | +## Task 1: Prepare the environment |
| 24 | + |
| 25 | +Set up your Azure environment before you begin. You create a resource group and a test resource to practice tagging and locking. |
| 26 | + |
| 27 | +> [!WARNING] |
| 28 | +> This project creates Azure resources that may incur charges. Complete the clean-up unit when you're done to avoid unintended expenses. |
| 29 | +
|
| 30 | +1. Sign in to the [Azure portal](https://portal.azure.com) with an account that has permissions to create and manage resources. |
| 31 | +2. In the portal search bar, search for **Resource groups** and select **Resource groups**. |
| 32 | +3. Select **+ Create**. Name the resource group **rg-gp-tags-locks**, choose your preferred region, and select **Review + create** then **Create**. |
| 33 | + |
| 34 | +## Task 2: Create a test storage account |
| 35 | + |
| 36 | +Create a low-cost storage account inside the resource group. This gives you a resource to tag and lock in the following exercises. |
| 37 | + |
| 38 | +1. In the portal search bar, search for **Storage accounts** and select **Storage accounts**. |
| 39 | +2. Select **+ Create**. |
| 40 | +3. On the Basics tab, select **rg-gp-tags-locks** as the resource group. |
| 41 | +4. For **Storage account name**, enter a globally unique name (for example, **stgptagslock** followed by your initials and a number). |
| 42 | +5. For **Region**, use the same region as the resource group. |
| 43 | +6. For **Preferred Storage Type**, select **Azure Blob Storage or Azure Data Lake Storage Gen 2**. |
| 44 | +7. For **Performance**, select **Standard**. |
| 45 | +8. For **Redundancy**, select **Locally-redundant storage (LRS)**. |
| 46 | +9. Select **Review + create** and then select **Create**. |
| 47 | +10. When deployment finishes, select **Go to resource**. |
| 48 | + |
| 49 | +## Task 3: Tag the resource group |
| 50 | + |
| 51 | +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. |
| 52 | + |
| 53 | +1. In the portal search bar, search for **Resource groups** and select **Resource groups**. |
| 54 | +2. Select **rg-gp-tags-locks** from the list. |
| 55 | +3. In the left menu, select **Tags**. |
| 56 | +3. Add the tag **department** with the value **development**. |
| 57 | +4. Add the tag **environment** with the value **test**. |
| 58 | +5. Select **Apply**. |
| 59 | +6. Confirm both tags appear in the tags list. |
| 60 | + |
| 61 | +> [!NOTE] |
| 62 | +> **Validation step:** Verify the resource group displays both tags (**department: development** and **environment: test**) before proceeding. |
| 63 | +
|
| 64 | +> [!NOTE] |
| 65 | +> 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. |
| 66 | +
|
| 67 | +## Task 4: Tag the storage account |
| 68 | + |
| 69 | +Apply the same tags to the storage account. Tagging resources individually ensures accurate cost reporting even when multiple teams share a resource group. |
| 70 | + |
| 71 | +1. Open the storage account you created. |
| 72 | +2. In the left menu, select **Tags**. |
| 73 | +3. Add the tag **department** with the value **development**. |
| 74 | +4. Add the tag **environment** with the value **test**. |
| 75 | +5. Select **Apply**. |
| 76 | + |
| 77 | +> [!NOTE] |
| 78 | +> **Validation step:** Confirm the storage account now shows both tags matching the resource group tags. |
| 79 | +
|
| 80 | +## Task 5: Create a second storage account with different tags |
| 81 | + |
| 82 | +Create another resource and assign different tag values. Having resources with different tags demonstrates how tags enable filtering and cost allocation across teams. |
| 83 | + |
| 84 | +1. In the portal search bar, search for **Storage accounts** and select **Storage accounts**. |
| 85 | +2. Select **+ Create**. |
| 86 | +3. On the Basics tab, select **rg-gp-tags-locks** as the resource group. |
| 87 | +4. For **Storage account name**, enter a globally unique name (for example, **stgptagsops** followed by your initials and a number). |
| 88 | +5. For **Region**, use the same region as the resource group. |
| 89 | +6. For **Preferred Storage Type**, select **Azure Blob Storage or Azure Data Lake Storage Gen 2**. |
| 90 | +7. For **Performance**, select **Standard**. |
| 91 | +8. For **Redundancy**, select **Locally-redundant storage (LRS)**. |
| 92 | +9. Select **Review + create** and then select **Create**. |
| 93 | +10. When deployment finishes, select **Go to resource**. |
| 94 | +11. In the left menu, select **Tags**. |
| 95 | +12. Add the tag **department** with the value **operations**. |
| 96 | +13. Add the tag **environment** with the value **test**. |
| 97 | +14. Select **Apply**. |
| 98 | + |
| 99 | +> [!NOTE] |
| 100 | +> **Validation step:** Verify the second storage account exists with **department: operations** and **environment: test** tags. |
| 101 | +
|
| 102 | +## Task 6: Filter resources by tag |
| 103 | + |
| 104 | +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. |
| 105 | + |
| 106 | +1. In the portal search bar, search for **Resource groups** and select **Resource groups**. |
| 107 | +2. Select **rg-gp-tags-locks** from the list. |
| 108 | +3. In the resource list, select **Add filter**. |
| 109 | +4. In the **Filter** dropdown, scroll down to **Tags** and select the **department** tag. |
| 110 | +5. In the **Operator** dropdown, select **Equals**. |
| 111 | +6. Select the checkbox next to **development** and select **Apply**. |
| 112 | +7. Confirm that only the **stgptagslock** storage account appears in the filtered list. |
| 113 | +8. 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. |
| 114 | +9. Confirm only the **stgptagsops** storage account appears. |
| 115 | +10. Select the **X** on the right side of the filter to clear it and show all resources again. |
| 116 | + |
| 117 | +> [!NOTE] |
| 118 | +> **Validation step:** Confirm filtering by **department** tag shows only the correct storage account for each department value. |
0 commit comments