Create Your First Resource Group

Learn to create your first resource group in Azure with this step-by-step tutorial. Understand the concept, follow a hands-on exercise, and troubleshoot common issues before moving to the next lesson in the Azure Tutorial track.

Focus: create your first resource group

Sponsored

You've got your Azure subscription ready, you know what a resource is, and now you're staring at a blank portal wondering: where do I actually put things? This is exactly where resource groups come in — the unsung backbone of every Azure deployment. Without understanding resource groups, you'll quickly end up with a tangled mess of resources that are hard to manage, track, and clean up. In this lesson, you'll learn how to create your first resource group and, more importantly, why it's the first step in any Azure project.

The problem this lesson solves

When you start working in Azure, it's tempting to just start creating virtual machines, databases, and storage accounts ad hoc. But without a logical container to organize them, you'll face a few immediate headaches:

  • No clear ownership or cost tracking — you can't easily tell which team or project a resource belongs to.
  • Hard to manage permissions — setting access for a group of resources means configuring each one individually.
  • Messy cleanup — when a project is done, deleting every resource one by one is tedious and error-prone.
  • Unexpected dependencies — resources often depend on each other (like a VM needing a network interface), and without grouping, those relationships are invisible.

Resource groups solve all of this by acting as a logical container that holds related resources for an Azure solution. They let you manage, monitor, and delete resources as a group, and they're the foundational unit for access control and cost reporting.

Core concept / mental model

Think of a resource group as a project folder on your computer. Just as you'd keep all files for one project in a dedicated folder, Azure resources that work together belong in the same resource group.

  • Logical, not physical — resources in a group can be in different regions; the group just ties them together logically.
  • One resource, one group — each resource can belong to only one resource group at a time, though you can move it later.
  • Hierarchy — groups live inside a subscription, and you can have multiple groups per subscription.

Azure Resource Manager (ARM) treats the resource group as the deployment scope. When you deploy a template, you deploy it to a group, and that group becomes a boundary for lifecycle management and access control.

How it works step by step

Creating a resource group is a simple operation, but it's worth understanding what Azure does under the hood:

  1. Authenticate — Azure CLI verifies your credentials (via az login or managed identity).
  2. Check subscription — you must be in the correct subscription context (az account show).
  3. Validate location — Azure checks that the group's location (the metadata region) is valid.
  4. Create the group — ARM stores the group association in the control plane, not tied to any specific resource region.
  5. Assign tags (optional) — you can add key-value tags immediately for organization.

The key insight: the location you choose for the resource group is not where resources live — it's where the metadata about the group is stored. Resources can be deployed to any region you choose.

Hands-on walkthrough

Let's create your first resource group using the Azure CLI, which is the most scriptable and repeatable method. If you haven't already, log in:

az login

Then set your subscription (optional if you only have one):

az account set --subscription "YourSubscriptionNameOrID"

Now create the resource group. In this example, we'll name it rg-mydemo-dev and place it in eastus (you can pick any valid region):

az group create --name rg-mydemo-dev --location eastus --tags "project=demo" "env=dev"

Expected output (abbreviated):

{
  "id": "/subscriptions/xxx/resourceGroups/rg-mydemo-dev",
  "location": "eastus",
  "name": "rg-mydemo-dev",
  "tags": {
    "project": "demo",
    "env": "dev"
  }
}

Pro tip: Adopt a naming convention like rg-[app]-[env]. It makes it easy to identify the resource group and its purpose at a glance.

To list your resource groups, run:

az group list --output table

Output:

Name           Location    Status
-------------  ----------  ----------
rg-mydemo-dev  eastus      Succeeded

Now let's add a simple resource to the group — a free-tier Log Analytics workspace, which is a good way to prove the concept:

az monitor log-analytics workspace create --resource-group rg-mydemo-dev --workspace-name my-demo-workspace --location eastus

After it finishes, verify the workspace is inside the group:

az resource list --resource-group rg-mydemo-dev --output table

You'll see the workspace listed. You can also check the Azure portal: navigate to Resource groups → select rg-mydemo-dev and you'll see the workspace inside.

Finally, consider tagging resources at creation time. For example:

az group create ... --tags "costCenter=12345" "owner=team-alpha"

This is invaluable for cost tracking when you have many groups.

Compare options / when to choose what

There are several ways to create a resource group. Here's a quick comparison:

Method Best for Pros Cons
Azure CLI Automation, scripting Fast, scriptable, versionable Requires CLI installed and login
Azure Portal Manual, one-off Visual, no setup Not repeatable, easy to misclick
ARM template / Bicep Infrastructure-as-code Declarative, versionable, reusable More complex to learn
Terraform Multi-cloud IaC Provider-agnostic, state management Requires extra tooling

Choose CLI for quick experiments and automation. Use Bicep/ARM for production deployments to ensure consistency across environments. Terraform is great if you're already using it for other clouds.

Troubleshooting & edge cases

Even this simple task can hit a few snags. Here are the most common:

  • az: command not found — You haven't installed the Azure CLI. Install it first, then log in.
  • ZSH: command not found: az — On macOS/Linux, you may need to restart your terminal or add az to PATH.
  • No subscriptions found — You haven't logged in or have no active subscriptions. Run az login and ensure you have the right account.
  • Location 'xyz' is not a valid location — You mistyped a region name. Use az account list-locations -o table to see valid names.
  • Resource group should be a string — You used a variable that's empty. Double-check parameter spelling.
  • Name conflicts — Resource group names must be unique within a subscription. If you see a conflict, choose another name.
  • Tags with spaces — When passing tags with spaces, quote them: --tags "project=my demo".

Edge case: Resource groups are not bound to a single region. You can deploy a resource group in eastus and then place a VM in westus inside that group — Azure handles it logically.

What you learned & what's next

You now understand the core concept behind creating your first resource group and have completed a practical exercise that demonstrates it. You can:

  • Explain what a resource group is and why it matters.
  • Create a resource group via Azure CLI with tags.
  • Add a resource (like a Log Analytics workspace) to the group.
  • Compare different ways to create groups and choose the right one.

The next lesson in the Azure Tutorial path will build on this foundation by showing you how to deploy a real workload — like a virtual machine or a web app — into the resource group you just created. You'll learn how to bundle resources together and manage them as a unit.

Key takeaway: The resource group is your project's home in Azure. Always create it first, tag it meaningfully, and deploy resources into it — you'll thank yourself later.

Practice recap

Create two resource groups: one for Development (rg-mydemo-dev) and one for Production (rg-mydemo-prod) using the Azure CLI, add a tag costCenter to each, and then deploy a free Log Analytics workspace into the dev group. List all resources in the dev group to confirm the workspace appears. This will prepare you for the next lesson where you'll deploy a complete virtual machine into one of your groups.

Common mistakes

  • Forgetting to set the correct subscription before creating a group — you might create it in the wrong one.
  • Choosing a resource group location that doesn't match your compliance needs — remember, it's metadata only, but some policies require specific regions.
  • Not using tags at creation time — adding them later requires extra steps and is often forgotten.
  • Creating resources outside the resource group the portal suggests, accidentally scattering them across groups.

Variations

  1. Use Azure PowerShell (New-AzResourceGroup) instead of CLI if you're in a PowerShell-centric environment.
  2. Use Bicep files to declare the resource group declaratively as part of your infrastructure-as-code template.
  3. Leverage Azure Policy to enforce naming conventions or required tags on all resource groups automatically.

Real-world use cases

  • Organizing resources for a microservices application by team, using one resource group per service and environment for clear cost tracking.
  • Setting up a shared development environment where multiple developers need access only to their project's resource group via role-based access control (RBAC).
  • Implementing a disaster-recovery strategy by grouping identical resources across regions into tagged resource groups, enabling bulk failover and deletion.

Key takeaways

  • A resource group is a logical container that holds related Azure resources; each resource belongs to exactly one group.
  • The resource group's location is metadata only — resources inside can live in any region.
  • Use a consistent naming convention like rg-[app]-[env] and always add tags for governance.
  • Azure CLI (az group create) is the quickest way to create a group and is scriptable for repeatability.
  • Always verify the correct subscription context before creating resources.
  • The resource group is the foundation for deploying, managing, and deleting resources together — master it before moving on.

Sponsored

Sponsored

Discussion

Questions, corrections, and tips help everyone reading this page.

0 comments

Add a comment

Shown publicly with your comment.

Be constructive · max 4,000 characters

No comments yet — start the thread.

Related tutorials, quizzes, and articles for this topic.