Intermediate · Microsoft Azure essentials · topic 23 of 50 · 25 min
How Azure is organised: tenants, subscriptions and resource groups
Explanation
Why the structure matters
On your first day with Azure at a company, someone says "it is in the prod subscription, in rg-payments, in Central India". If you understand the structure, that sentence tells you who pays for it, who can touch it, and how to delete it safely. If you do not, Azure feels like a maze. So we start with the map before any services.
The hierarchy, top to bottom
| Level | What it is | Example |
|---|---|---|
| Microsoft Entra tenant | Your organisation's identity directory: users, groups, apps. Every subscription trusts exactly one tenant | contoso.onmicrosoft.com |
| Management groups | Folders for subscriptions, so policies and access can be set once for many. Up to six levels deep below the root | mg-root, mg-prod, mg-dev |
| Subscription | A billing boundary (one invoice line) and an access boundary, with its own quotas | sub-payments-prod |
| Resource group | A container for resources that share a lifecycle: created, managed and deleted together | rg-payments-prod |
| Resource | One thing you pay for and manage | vm-web-01, a storage account, a VNet |
A few rules about resource groups catch people out. Every resource belongs to exactly one resource group. Resource groups cannot be nested. A resource group has a location, which is where its metadata is stored, but the resources inside can be in other regions. Deleting a resource group deletes everything in it, which is very handy for labs and very dangerous in production. Protect important groups with a resource lock (CanNotDelete or ReadOnly).
Azure Resource Manager (ARM)
Azure Resource Manager is the single front door for creating and managing resources. The portal, the Azure CLI, PowerShell, Terraform and SDKs all send their requests to ARM, which checks your identity and permissions, applies Azure Policy, and then asks the right resource provider (such as Microsoft.Compute for VMs or Microsoft.Storage for storage) to do the work.
Because everything goes through ARM, you can describe resources in a template file and deploy it again and again. ARM templates are JSON. Bicep is a shorter, friendlier language that compiles to ARM JSON, and it is what Microsoft recommends for new templates. You will meet infrastructure as code properly in a later module.
param location string = resourceGroup().location
resource sa 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: 'stdemo${uniqueString(resourceGroup().id)}'
location: location
sku: { name: 'Standard_LRS' }
kind: 'StorageV2'
}Regions, region pairs and availability zones
A region is a set of datacentres in one geographic area. Many regions have availability zones: separate datacentre groups inside the region with their own power, cooling and networking, so one zone can fail without taking down the others. Many regions are also paired with another region in the same geography; Azure uses pairs for things like geo-redundant storage and staggers platform updates between them.
India has three main public regions: Central India in Pune, South India in Chennai and West India in Mumbai. Central India and South India are a region pair, and Central India supports availability zones. Microsoft has announced more Indian regions, so check the current region list and which services each region offers. Data residency rules (for example for banks and government work) often decide the region for you.
Four ways to work with Azure
- Azure portal (portal.azure.com): the web console. Good for learning and for looking around.
- Azure CLI: the az command, on Windows, macOS and Linux. Good for scripts.
- Azure PowerShell: the Az module, with commands like New-AzResourceGroup. Popular with Windows administrators.
- Azure Cloud Shell: a browser terminal inside the portal with both az and PowerShell ready and already signed in.
az login # opens the browser to sign in
az account show --output table # which subscription am I using?
az account set --subscription "sub-payments-dev"
az group create --name rg-demo --location centralindia
az group list --output table
az group delete --name rg-demo --yes --no-wait # deletes EVERYTHING insideConnect-AzAccount
Get-AzContext
New-AzResourceGroup -Name rg-demo -Location centralindia
Get-AzResourceGroup | Format-Table ResourceGroupName, LocationResource IDs
Every resource has a unique resource ID, a path that spells out where it lives: /subscriptions/{subscription-id}/resourceGroups/{group}/providers/{namespace}/{type}/{name}. For a VM that looks like /subscriptions/1111.../resourceGroups/rg-web/providers/Microsoft.Compute/virtualMachines/vm-web-01. You will paste these into role assignments, policies and scripts all the time.
Need help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
How Azure is organised: tenants, subscriptions and resource groups · 1/7
This lesson is the map of Azure: how everything is organised, from your organisation down to a single virtual machine.
Prefer a video by a teacher? Find free videos on “azure management groups subscriptions resource groups explained az-900” on YouTube ↗
In real life: A Mumbai insurance company sets up Azure
An insurance company moving its customer portal to Azure creates management groups for Production and Non-production under the root. Each product team gets its own subscriptions, so the finance team sees one bill line per team. A policy at the Production management group allows only the Central India and South India regions, to meet data residency needs. Inside sub-portal-prod, resource groups follow the app's lifecycle: rg-portal-web, rg-portal-data and rg-portal-network, each with a CanNotDelete lock. Developers in the non-production subscription can create and delete resource groups freely for experiments.
az group create --name rg-portal-web --location centralindia --tags Project=portal Environment=prod
az lock create --name no-delete --lock-type CanNotDelete --resource-group rg-portal-webPractice (0/3 done)
Which Azure level is the main billing boundary that also sets quotas?
Write build_id(subscription_id, resource_group, namespace, resource_type, name) that returns "/subscriptions/{id}/resourceGroups/{rg}/providers/{ns}/{type}/{name}", and parse_id(resource_id) that turns such a string back into a dict with keys "subscription", "resource_group", "namespace", "type" and "name". The words subscriptions, resourceGroups and providers may appear in any letter case. If the ID does not have exactly this shape, parse_id must raise ValueError.
Using Azure Cloud Shell or the Azure CLI on your laptop (a free account is enough), create a resource group in Central India with two tags, add a storage account to it, look at the resource ID of the storage account, then delete the whole resource group. Write down every command you ran.
Quick quiz
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- Microsoft Entra ID and Azure RBACMicrosoft Azure essentials · same module
- Azure compute and storageMicrosoft Azure essentials · same module
- Azure networking, Functions, databases and monitoringMicrosoft Azure essentials · same module
- Google Cloud structure: projects, billing and IAMGoogle Cloud and comparing the clouds
- The command line on all three cloudsGoogle Cloud and comparing the clouds
- AWS vs Azure vs Google Cloud: the service mapGoogle Cloud and comparing the clouds
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
What happens when you delete a resource group?
Answer: All resources inside it are deleted too
A resource group shares one lifecycle: deleting it deletes every resource it contains.
Can a resource group in Central India contain a VM in South India?
Answer: Yes: the group's location only stores its metadata
Resources in one group can be in different regions. The group's location is where its metadata is kept.
Which Indian Azure region is in Pune?
Answer: Central India
Central India is in Pune, South India in Chennai and West India in Mumbai.
What is Bicep?
Answer: A language that describes Azure resources and compiles to ARM JSON templates
Bicep is Microsoft's infrastructure-as-code language for Azure; it is converted to ARM JSON when deployed.
Which command creates a resource group named rg-demo in Central India?
Answer: az group create --name rg-demo --location centralindia
az group create takes --name and --location, and CLI region names are lower case with no spaces.
What is the difference between Entra roles and Azure roles?Related
Answer: Entra roles manage the directory (users, apps); Azure roles manage Azure resources
Global Administrator is an Entra role; Owner and Contributor are Azure roles. They are separate systems.
A contract says customer data must stay in India. What do you check FIRST when picking a region?Related
Answer: Compliance: only Indian regions qualify
A legal or contract rule is a hard filter, so it comes before latency or price.
Which redundancy keeps 3 copies across availability zones AND copies in a paired region?Related
Answer: GZRS
GZRS is ZRS in the primary region plus asynchronous copies in the secondary region.
Which city is the Google Cloud region asia-south2 in?Related
Answer: Delhi
asia-south1 is Mumbai and asia-south2 is Delhi.
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- 3 more topics in “Microsoft Azure essentials” before its exam: Microsoft Entra ID and Azure RBAC, Azure compute and storage, Azure networking, Functions, databases and monitoring.
- Module 6 exam: Microsoft Azure essentials · 13 questions · 20 min, without help. 4 topics of this module still to finish first.
- Then the next module, Google Cloud and comparing the clouds. 50 topics left in the course before the final exam.