In simple words
- Subscription: a billing and access boundary that holds your Azure resources.
- Management group: a folder of subscriptions, used to apply rules and access to many at once.
- Resource group: a folder for related resources (an app's VM, database and network) that you manage and delete together.
- Resource: one thing you create, such as a VM, a storage account or a database.
Big picture
Before you create anything in Azure, you need to know where it lives. Azure organizes everything in a tree. Think of a company: the whole company at the top, departments below, and project folders inside each department. Rules and budgets set high up flow down to everything below.
The four levels
Tenant (your company's Microsoft Entra directory)└── Management group: Production └── Subscription: shop-prod └── Resource group: rg-shop-web-prod └── Resources: VM, database, storage account| Level | What it is | Why it matters |
|---|---|---|
| Tenant | Your organization's identity directory (lesson 03) | One set of users for everything |
| Management group | A folder that holds subscriptions | Apply rules and access to many subscriptions at once |
| Subscription | A billing and limits boundary | Each gets its own bill and its own quotas |
| Resource group | A folder for resources that live and die together | Delete the group, and everything in it goes |
| Resource | One thing, such as a VM | The thing you actually pay for |
Access (RBAC) and policies set at a higher level are inherited by everything below.
Resource groups in practice
A resource group holds things with the same life. If you would delete them together, put them together.
az group create --name rg-shop-web-dev --location westeurope --tags env=dev owner=anna cost-center=1042{ "id": "/subscriptions/1111-aaaa/resourceGroups/rg-shop-web-dev", "location": "westeurope", "name": "rg-shop-web-dev", "properties": { "provisioningState": "Succeeded" }, "tags": { "cost-center": "1042", "env": "dev", "owner": "anna" }}az group list --query "[].{Name:name, Region:location}" -o tableaz group delete --name rg-shop-web-dev --yes --no-waitFacts to remember:
- A resource belongs to exactly one resource group.
- The group has a region only for its own metadata. Resources inside can be in other regions.
- Deleting a group deletes everything inside it. This is useful for test environments and dangerous in production.
Working with subscriptions
az account list --query "[].{Name:name, Id:id, Default:isDefault}" -o tableaz account set --subscription "shop-prod"az account show --query "{sub:name, tenant:tenantId}"Name Id Default---------- ---------- ---------shop-dev 1111-aaaa Trueshop-prod 2222-bbbb FalseMany teams use one subscription per environment (dev, test, prod). That keeps costs separate and limits damage from mistakes.
Naming and tags
Use a clear naming pattern so anyone can read it: <type>-<app>-<role>-<env>, for example rg-shop-web-prod, vm-shop-api-01, st for storage. Microsoft's Cloud Adoption Framework lists suggested short names.
Tags are key and value labels (env=prod, owner=anna). They are how you find owners and split costs. Tags are not inherited by default. Azure Policy (lesson 19) can force or copy them.
Locks
A lock stops accidental changes.
az lock create --name keep --lock-type CanNotDelete --resource-group rg-shop-web-prodCanNotDelete allows changes but blocks deletion. ReadOnly blocks all changes, which can surprise you (for example it can block some start and restart actions). Even owners must remove a lock before deleting.
Common mistakes
- Putting unrelated things in one huge resource group, so you can never clean up.
- Mixing dev and prod in one subscription with the same access.
- Not tagging, then having no idea who owns a costly resource.
- Using
ReadOnlylocks without testing what they block.
Summary
- Azure is a tree: tenant, management groups, subscriptions, resource groups, resources.
- Rules and access flow downward from higher levels.
- A resource group is a folder of things that share a life.
- Use one subscription per environment, a naming pattern, tags and locks.
CHECK YOUR UNDERSTANDING
3 quick questions
1. What happens when you delete a resource group?
2. Where would you apply one policy to many subscriptions at once?
3. What does a CanNotDelete lock do?
You've finished the free preview of Microsoft Azure
Upgrade to Pro to unlock the remaining 21 lessons, every practice lab and a certificate when you finish.
See plans