Azure Resource Groups
The folder system that keeps your cloud organized — and makes cleanup a single command.
A Resource Group is a container that holds related Azure resources — a VM, its disk, its network, its IP — so you can manage them as one unit. It’s one of Azure’s most practical ideas and has no exact single equivalent in AWS.
🎯 Learning Objectives
By the end of this lesson you will:
- Understand what a resource group is and why it’s useful
- Create and delete resource groups with the CLI
- Apply tags for organization and cost tracking
- Understand the lifecycle benefit of grouping resources
Why Resource Groups Matter
Everything in Azure lives inside a resource group. Grouping gives you:
- Lifecycle management — deploy or delete an entire application’s resources together.
- Access control — apply permissions (RBAC) at the group level.
- Cost visibility — see spend per group, often per project or environment.
- Organization — a clear place for everything, e.g.
rg-shop-prod,rg-shop-dev.
💡 A common pattern
Teams often create one resource group per application per environment — rg-webapp-dev, rg-webapp-prod. When a project ends, deleting the group cleans up everything in one move.
Create a Resource Group
az group create \
--name rg-devops-lab \
--location westeuropeTag Resources for Cost Tracking
Tags are key/value labels that make billing and organization far easier:
az group update --name rg-devops-lab \
--set tags.environment=dev tags.project=learning-hubClean Up in One Command
This is the real payoff. Deleting a resource group deletes everything inside it:
az group delete --name rg-devops-lab --yes --no-wait⚠ Deletion is permanent and recursive
az group delete removes every resource in the group — VMs, disks, networks, data. There’s no undo. Double-check the group name, especially before running it against anything that might be production.
🧪 Hands-on Lab
Create, Tag, and Delete a Group
- Create a resource group
rg-lab-01in a region near you. - Add tags
environment=devandowner=you. - List your resource groups as a table.
- Delete the group and confirm it’s gone.
🧠 Knowledge Check
What happens when you delete a resource group?
What is a common reason to use tags on resource groups?
💼 Interview Preparation
How do Azure resource groups help with cost management and cleanup?
Summary
Resource groups are Azure’s organizational backbone — grouping related resources for management, access control, cost tracking, and one-command cleanup. Next, you’ll launch an actual Virtual Machine inside one.