What is a Resource Group in Azure? Your First Building Block
Azure·August 19, 2026·6 min read

What is a Resource Group in Azure? Your First Building Block

What You'll Learn

You'll learn what Azure resource groups are, why Azure requires them for everything you build, how to organize them effectively, and how they handle lifecycle management. This is the first concept you need to understand before creating any Azure resource.

Prerequisites

An Azure free account. That's it. This guide is truly beginner level. If you've logged into the Azure portal once, you're ready.

Every Azure Resource Needs a Home

In Azure, you can't create anything without first putting it in a resource group. Want to create a virtual machine? You need a resource group first. A storage account? Resource group. A database? Resource group.

Think of a resource group like a project folder on your desk. Everything related to one project goes in one folder. When the project is done, you can throw away the whole folder and everything inside it goes with it.

That's exactly how resource groups work. They're containers that hold related Azure resources together. When you delete the resource group, everything inside gets deleted too.

What a Resource Group Actually Is

A resource group is a logical container. It's not a physical thing. It doesn't cost money. It doesn't run code or store data. It's just an organizational boundary that groups resources together.

Here are the key facts:

Every resource belongs to exactly one resource group. You can't put a virtual machine in two resource groups. You can't leave a storage account without a resource group. One resource, one group.

A resource group has a location, but the resources inside can be in different regions. Your resource group might be in Canada Central, but you can put a VM in East US and a storage account in West Europe inside it. The resource group location just determines where Azure stores the metadata about the group.

Deleting a resource group deletes EVERYTHING inside it. This is the most important rule. When you click delete on a resource group, Azure deletes every single resource in that group. No confirmation per resource. No undo. Everything goes. This is powerful for cleaning up test environments, but dangerous if you delete the wrong group.

How to Organize Resource Groups

Beginners overthink this. You don't need a perfect organization strategy before you start. You need a simple pattern that makes sense for what you're building.

Here are three common patterns:

By Environment

Create separate resource groups for dev, test, and production.

  • dev-rg
  • test-rg
  • prod-rg

This works well when you're building the same application across multiple environments. Everything for dev goes in the dev resource group. Everything for production goes in the production resource group. Simple.

By Application

Create separate resource groups for each application or service.

  • webapp-rg
  • database-rg
  • monitoring-rg

This works well when different teams manage different parts of your infrastructure. The web team owns the webapp resource group. The data team owns the database resource group.

By Lifecycle

Group resources that get created and deleted together.

  • short-term-test-rg (delete after a week)
  • permanent-infrastructure-rg (keep forever)

This works well for learning environments and temporary projects. When you're done testing, delete the whole group and everything disappears.

Pick one pattern and start. You can always create new resource groups later. Don't wait for the perfect organization before you build anything.

Creating Your First Resource Group

You can create a resource group through the Azure portal or the Azure CLI. The portal is fine for learning, but the CLI is faster once you know the command.

Here's the CLI command:

az group create --name my-first-rg --location canadacentral

Let me break down what just happened:

  • az group create tells Azure to create a new resource group
  • --name my-first-rg sets the name of the resource group
  • --location canadacentral sets where Azure stores the metadata

That's it. The resource group now exists. You can go to the Azure portal, search for "resource groups", and you'll see my-first-rg in the list.

Now you can create resources inside it. When you create a VM or storage account, Azure will ask you which resource group to use. Pick my-first-rg and the resource gets placed inside.

Common Mistakes

Here are the mistakes beginners make with resource groups:

Creating one giant resource group for everything. You might think "I'll just put everything in one resource group to keep it simple." This backfires fast. When you want to delete your test VM, you can't delete just the VM without deleting the entire group. When you want to give someone access to one application, you end up giving them access to everything. Start with separate resource groups from the beginning.

Not realizing deletion cascades. This is the biggest danger. You delete a resource group thinking you're just cleaning up the container. Everything inside gets deleted too. Always check what's in a resource group before you delete it. In the portal, click the resource group and look at the resources list. In the CLI, run az resource list --resource-group my-first-rg to see what's inside.

Overthinking the organization before they have anything to organize. Keep it simple. Create a resource group, build something, and adjust later if needed. The perfect organization doesn't matter when you're just learning.

Practice Exercise

Here's what to do next. Open the Azure portal or the Azure CLI and complete this exercise:

  1. Create two resource groups: learn-web-rg and learn-data-rg
  2. List all your resource groups to confirm they exist
  3. When you're done practicing, delete both resource groups

In the CLI, that looks like this:

az group create --name learn-web-rg --location canadacentral
az group create --name learn-data-rg --location canadacentral
az group list --output table
az group delete --name learn-web-rg --yes
az group delete --name learn-data-rg --yes

The --output table flag formats the list as a readable table instead of JSON. The --yes flag skips the confirmation prompt when deleting.

Run through this exercise a few times until creating and deleting resource groups feels automatic. This is a foundational skill you'll use every single day in Azure.

What's Next

Now that you understand resource groups, you're ready to create actual resources inside them.

The next concepts to learn are:

Every single one of these resources requires a resource group. Now you know how to create one.

Resource groups are also a key topic on the Azure AZ-104 Administrator exam. If you're studying for that certification, understanding resource group organization, role-based access control at the resource group level, and lifecycle management will help you answer scenario questions.

Start with resource groups. Build from there. Everything else in Azure fits inside this container.