Skip to content

Intermediate · Microsoft Azure essentials · topic 23 of 50 · 25 min

How Azure is organised: tenants, subscriptions and resource groups

Explanation

Azure is organised as a tree: a Microsoft Entra tenant at the top, then management groups, subscriptions (each one a billing and access boundary), resource groups (containers that share a lifecycle), and finally resources such as VMs and storage accounts. Azure Resource Manager handles every request, whether it comes from the portal, the Azure CLI, PowerShell or a Bicep template. Resources live in regions, many of which have availability zones; India has Central India (Pune), South India (Chennai) and West India (Mumbai).

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

LevelWhat it isExample
Microsoft Entra tenantYour organisation's identity directory: users, groups, apps. Every subscription trusts exactly one tenantcontoso.onmicrosoft.com
Management groupsFolders for subscriptions, so policies and access can be set once for many. Up to six levels deep below the rootmg-root, mg-prod, mg-dev
SubscriptionA billing boundary (one invoice line) and an access boundary, with its own quotassub-payments-prod
Resource groupA container for resources that share a lifecycle: created, managed and deleted togetherrg-payments-prod
ResourceOne thing you pay for and managevm-web-01, a storage account, a VNet
Think of it like this: Think of a big college. The tenant is the college itself, with its register of students and staff. Management groups are faculties (engineering, arts). Subscriptions are departments, each with its own budget. Resource groups are the labs inside a department, and resources are the computers and projectors in each lab. A rule made at faculty level applies to every lab below it.

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.

output
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'
}
main.bicep: one storage account. Deploy with: az deployment group create --resource-group rg-demo --template-file main.bicep

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.
bash
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 inside
The first Azure CLI commands. Region names in the CLI are lower case with no spaces.
powershell
Connect-AzAccount
Get-AzContext
New-AzResourceGroup -Name rg-demo -Location centralindia
Get-AzResourceGroup | Format-Table ResourceGroupName, Location
The same with the Azure PowerShell Az module.

Resource 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.

Careful: Common mistakes: (1) Working in the wrong subscription. Run az account show before any delete. (2) Putting dev and prod resources in one resource group, so you cannot delete the dev parts cleanly. Group by lifecycle and environment. (3) Thinking a resource group's location limits where its resources go: it does not. (4) Deleting a resource group to remove one item. Delete the item instead.
Tip: Follow a naming convention such as the Microsoft Cloud Adoption Framework abbreviations: rg- for resource groups, vm- for VMs, vnet- for networks, st for storage accounts (which allow only lower-case letters and numbers).

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

How Azure is organised

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.

bash
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-web
Create a tagged resource group and protect it with a delete lock.

Practice (0/3 done)

Task 1 · Question

Which Azure level is the main billing boundary that also sets quotas?

Task 2 · Code · Python

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.

Task 3 · Practice

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

Question 1

1.What happens when you delete a resource group?

Question 2

2.Can a resource group in Central India contain a VM in South India?

Question 3

3.Which Indian Azure region is in Pune?

Question 4

4.What is Bicep?

Question 5

5.Which command creates a resource group named rg-demo in Central India?

Read more (free)

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.

From Microsoft Entra ID and Azure RBAC

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.

From Regions, availability zones and edge locations

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.

From Azure compute and storage

Which city is the Google Cloud region asia-south2 in?Related

Answer: Delhi

asia-south1 is Mumbai and asia-south2 is Delhi.

From Google Cloud structure: projects, billing and IAM

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

  1. 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.
  2. Module 6 exam: Microsoft Azure essentials · 13 questions · 20 min, without help. 4 topics of this module still to finish first.
  3. Then the next module, Google Cloud and comparing the clouds. 50 topics left in the course before the final exam.

← Previous: Cost control in practice