Subscriptions and Resource Groups
Azure organises everything in a hierarchy. Getting it right early keeps permissions, billing and clean-up simple.
On this page · 5 min · Beginner
On this page
- Learning objectives
- Explanation
- Code example
- Step by step
- Real-world use
- Common mistakes
- Best practices
- Remember this
- Practice exercise
- Mini quiz
- Related topics
- My notes
- Reading time
- 5 min
- Difficulty
- Beginner
- Updated
- Oct 29, 2026
Related tutorials
Learning objectives#
- Explain management groups, subscriptions and resource groups
- Group resources by lifecycle
- Apply tags for cost tracking
- Assign access at the right scope
Explanation#
The hierarchy is: management groups → subscriptions → resource groups → resources. Settings and permissions applied higher up are inherited below.
A subscription is a billing and access boundary. Many companies use separate subscriptions for production and development.
A resource group holds resources that share a lifecycle — created, updated and deleted together, such as a web app, its database and its storage.
Tags are key–value labels (environment=prod, owner=asha) used for cost reports and automation.
Code example: A tagged resource group with scoped access#
az group create --name rg-shop-dev --location centralindia \
--tags environment=dev owner=asha project=shop
# Give a teammate Contributor rights on this group only
az role assignment create --assignee ravi@example.com \
--role Contributor \
--scope /subscriptions/<subscription-id>/resourceGroups/rg-shop-dev
az group list --tag project=shop --output table
Name Location Status ----------- ------------ --------- rg-shop-dev centralindia Succeeded
This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.
Step-by-step explanation#
- The resource group gets three tags for reporting.
- The role assignment is scoped to one resource group, not the whole subscription.
- Filtering by tag lists every group belonging to the project.
Real-world use case#
A team keeps rg-shop-dev, rg-shop-test and rg-shop-prod. Developers have Contributor on dev and test, but only Reader on prod.
Common mistakes#
Mixing unrelated apps makes permissions and clean-up risky. Group by application and lifecycle.
Owner can grant access to others. Give the least privilege that does the job.
Best practices#
- Separate production and non-production subscriptions
- Use a consistent naming convention (rg-app-env)
- Enforce required tags with Azure Policy
- Assign roles to groups, not individuals
Remember this#
Management group → Subscription → Resource group → Resource.
Resource group = things that live and die together.
Tags make the bill readable.
Practice exercise#
Your task: Create rg-blog-prod with tags environment=prod and owner=you, then list its tags.
Show solution
az group create -n rg-blog-prod -l centralindia --tags environment=prod owner=you
az group show -n rg-blog-prod --query tags
Mini quiz#
What is the main billing boundary in Azure?
Want more? Practise all Microsoft Azure MCQs · Microsoft Azure interview questions
My notes#
Saved in this browser.