Skip to content
Visual explainer 2h to learn 5 steps

Organise Azure resources and environments

Place tenants, management groups, subscriptions, resource groups and resources correctly and reason about ARM scope.

By Invicly Tech, , in Microsoft Azure Cloud Engineering. About 11 minutes to read.

Topic 2 of 33

In short

Everything you create in Azure sits in a hierarchy: a Microsoft Entra tenant holds identities, management groups group subscriptions, a subscription is a billing and access boundary, resource groups hold resources that share a lifecycle, and resources are the actual services. Azure Resource Manager (ARM) is the single API behind the portal, CLI and templates, and every request is aimed at a scope in that hierarchy. Settings such as access and policy flow down from the scope where you set them.

Think of it like this: The tenant is the company, management groups are divisions, subscriptions are departmental budgets, resource groups are project folders, and resources are the files inside them.

Explained simply

Azure organises everything in levels, a bit like folders on a computer. At the top is your tenant, which is your organisation's directory in Microsoft Entra ID. It holds users, groups and app identities. It does not hold servers or databases itself.

Below the tenant you can create management groups. They let you group subscriptions, for example all production subscriptions, and set rules once for the whole group. Every tenant starts with one called the tenant root group.

A subscription is where costs are added up and billed, and where many limits, called quotas, are counted. Teams often get separate subscriptions for production, development and sandbox work, so costs and access stay apart.

Inside a subscription you create resource groups. A resource group is a container for resources that belong together and are created and deleted together, such as one app's web service, database and storage. Delete the group and everything inside goes with it.

All of this is managed by Azure Resource Manager, often shortened to ARM. Whether you click in the portal, type an az command or deploy a template, the request goes to ARM, which checks your access and passes the work to the right service.

Press Play on a diagram to walk through it one step at a time.

MapOne tenant, organised by environment
Entra tenant (contoso.onmicrosoft.com)
  • Tenant root group
    • Holds every management group and subscription
  • Management group: Platform
    • Subscription: connectivity
    • Subscription: management
  • Management group: Workloads
    • Subscription: app-prod
    • Subscription: app-dev
  • Management group: Sandbox
    • Subscription: lab-alex
    • Resource group: rg-lab-api
FlowHow a request reaches a resource
  1. Step 1
    Tool

    Portal, CLI, PowerShell, Bicep or SDK

  2. Step 2
    Entra sign-in

    You get a token for management.azure.com

  3. Step 3
    Resource Manager

    Checks RBAC, policy and locks at the scope

  4. Step 4
    Resource provider

    For example Microsoft.Storage creates the account

SequenceCreating a resource with an unregistered provider
Engineer (az CLI)
Azure Resource Manager
Microsoft.App provider
  1. 1Create a container app environment
    Engineer (az CLI) to Azure Resource Manager: Create a container app environment
  2. 2Error: subscription not registered for Microsoft.App
    Azure Resource Manager to Engineer (az CLI): Error: subscription not registered for Microsoft.App
  3. 3az provider register --namespace Microsoft.App
    Engineer (az CLI) to Azure Resource Manager: az provider register --namespace Microsoft.App
  4. 4Register subscription with provider
    Azure Resource Manager to Microsoft.App provider: Register subscription with provider
  5. 5Retry the create
    Engineer (az CLI) to Azure Resource Manager: Retry the create
  6. 6Forward the request; resource is created
    Azure Resource Manager to Microsoft.App provider: Forward the request; resource is created

In depth

Tenant and subscription are different things

Beginners often mix up the tenant and the subscription. The tenant is about identity: who can sign in. The subscription is about resources and money: what exists and who pays. A subscription trusts exactly one tenant for sign-in, while one tenant can trust many subscriptions.

You can see both in the CLI. az account show returns a tenantId and an id; the id is the subscription. If you are a guest in a customer's tenant, you may see their subscriptions as well as your own, under a different tenantId. Moving a subscription to another tenant is possible, but it removes existing role assignments and can break managed identities and Key Vault access, so it is a planned change, not a quick fix.

  • Tenant: users, groups, apps, sign-in
  • Subscription: resources, billing, quotas
  • One subscription trusts one tenant
  • az account show prints both IDs

Management groups and subscriptions in practice

Management groups form a tree under the tenant root group, which is useful for applying the same access or policy to many subscriptions. A management group tree can be up to six levels deep, not counting the root and the subscriptions, but most organisations need only two or three. A common shape is Platform for shared services such as networking and logging, Landing zones or Workloads for applications, Sandbox for experiments, and Decommissioned for subscriptions being closed.

Each subscription sits under exactly one management group. When you move it, it picks up the access and policy of its new parent and loses those of the old one. That is powerful: moving a sandbox subscription into a stricter group immediately applies the stricter rules. It is also risky, so treat moves like a deployment and check the policies and role assignments at the destination first.

MapWhere to put things
Decide the container
  • Different sign-in directory?
    • Separate tenant (rare)
  • Different bill, quota or blast radius?
    • Separate subscription
  • Same rules for many subscriptions?
    • Management group
  • Created and deleted together?
    • Same resource group

Resource groups by lifecycle

The best rule for resource groups is lifecycle: resources that are deployed, updated and deleted together belong in one group. A lab API, its storage account and its key vault fit in rg-lab-api. A shared virtual network that outlives many apps belongs in its own group. Splitting by resource type, such as one group for all databases, usually backfires because no single team owns the group's lifecycle.

A resource group has a location, but that only says where its metadata is stored. Its resources can be in any region. Resources can be moved between groups and subscriptions for many, but not all, resource types, and moves lock both groups while they run. Names are worth a convention, such as rg-app-env-region, so people can tell what a group is for without opening it.

  • Group by lifecycle, not by resource type
  • Group location stores metadata only
  • Not every resource type can be moved
  • Use a naming pattern such as rg-api-dev-weu

ARM scopes and resource providers

Every resource has an ID that is also its scope path: /subscriptions/ID/resourceGroups/NAME/providers/NAMESPACE/TYPE/NAME. Management groups use /providers/Microsoft.Management/managementGroups/ID. When you assign a role or a policy, you pick one of these paths, and the assignment applies there and below.

The namespace part, such as Microsoft.Storage or Microsoft.App, names a resource provider: the service that actually creates and manages that type. A subscription must be registered for a provider before you can create its resources. Many common providers are registered automatically, and the portal often registers others for you, but CLI and template deployments can fail with a message that the subscription is not registered to use a namespace. Registering is a subscription-level action that needs a role such as Contributor at that scope.

Learn it in 5 short steps

About 25m each. Track them with a timer in your plan.

  1. 1
    Distinguish tenant and subscription~25m
  2. 2
    Use management groups~25m
  3. 3
    Group resources by lifecycle~25m
  4. 4
    Understand ARM scopes~25m
  5. 5
    Register resource providers~25m

Key points

  • A subscription trusts exactly one Entra tenant; one tenant can hold many subscriptions.
  • Group resources by lifecycle: things created and deleted together belong in one resource group.
  • A resource group has a location for its metadata, but its resources can live in other regions.
  • Role assignments and policy assignments made at a higher scope are inherited by everything below it.
  • A resource provider (such as Microsoft.ContainerInstance) must be registered in a subscription before you use its types.

Key terms

Tap a card to flip it. 0/6 known

Examples

bash
# Scopes are paths; each level adds a segment
# /providers/Microsoft.Management/managementGroups/mg-sandbox
# /subscriptions/<subscription-id>
# /subscriptions/<subscription-id>/resourceGroups/rg-lab-api
# /subscriptions/<subscription-id>/resourceGroups/rg-lab-api/providers/Microsoft.Storage/storageAccounts/stlabapi01

az provider show --namespace Microsoft.ContainerInstance --query registrationState -o tsv
az provider register --namespace Microsoft.ContainerInstance

The four ARM scope levels, and registering a resource provider.

Laying out a small company's Azure estate

Contoso has one Entra tenant and three teams. They create management groups Platform, Workloads and Sandbox under the tenant root group. Platform holds a connectivity subscription for the shared network. Workloads holds app-prod and app-dev subscriptions, so production costs and access are separate. Sandbox holds one subscription per learner. Inside app-dev, each app gets one resource group per environment, such as rg-orders-dev-weu, holding its app, database and storage. A policy that limits regions is assigned once on Workloads and applies to both app subscriptions.

Reading scopes from the CLI

An engineer wants the exact scope string for a role assignment and wants to know which providers are registered. They read the IDs from the CLI rather than typing them by hand, which avoids typos in long paths.

bash
az account show --query "{subscription:id, tenant:tenantId}" -o table
az group show --name rg-lab-api --query id -o tsv
# /subscriptions/<subscription-id>/resourceGroups/rg-lab-api

az account management-group list -o table   # needs read access to management groups

az provider list --query "[?registrationState=='Registered'].namespace" -o tsv | sort | head
az provider register --namespace Microsoft.App --wait

Quick reference

  • Tenant > management groups > subscription > resource group > resource.
  • Tenant = identity; subscription = billing, quota and access boundary.
  • Put resources that share a lifecycle in one resource group.
  • Resource IDs are scope paths: /subscriptions/ID/resourceGroups/NAME/providers/...
  • Assignments at a scope are inherited by every level below it.
  • az provider register --namespace Microsoft.App registers a provider for the subscription.
  • Management group tree: up to six levels below the root, but keep it shallow.

Common mistakes

  • Mixing production and test resources in one resource group, so you cannot delete or lock one without the other.
  • Confusing the tenant (identity) with the subscription (billing): moving a subscription to another tenant removes its existing role assignments.
  • Seeing a 'subscription is not registered to use namespace' error and assuming you lack access; usually the provider just needs registering.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1What is the main purpose of a subscription?

Question 2

2Which resources should share a resource group?

Question 3

3A deployment fails because the subscription is not registered to use Microsoft.ContainerInstance. What do you do?

Question 4

4You move a subscription from the Sandbox management group to Workloads. What happens to access and policy?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Write down the full scope path for a storage account named stlabapi01 in resource group rg-lab-api, using a placeholder subscription ID.

  2. Exercise 2medium

    In your lab subscription, check whether Microsoft.App is registered, register it if not, and record the registrationState before and after as evidence.

  3. Exercise 3hard

    Design-only: Fabrikam has a web shop (prod and test), a shared hub network and a data science team that experiments freely. Propose management groups, subscriptions and example resource groups, and say where you would assign an allowed-regions policy.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Do I need management groups for a personal lab?
No. A single subscription with resource groups is enough. Management groups pay off once you have several subscriptions that need the same rules.
Can one resource be in two resource groups?
No. Each resource belongs to exactly one resource group, although it can be moved to another for many resource types.
What happens to resources if I delete a resource group?
Every resource inside it is deleted too. Locks on the group or its resources block the delete, which is why important groups get a CanNotDelete lock.

Go deeper

ShareXLinkedInWhatsApp