Guide to Create, List, Delete and Deploy Azure Resource Groups using Command Line Interface (CLI)

Topics covered in this blog post:

  1. What is a Resource Group?
  2. Creating a Resource Group
  3. Listing Resource Groups
  4. Deleting a Resource Group
  5. Deploying Resources

If you’ve just started exploring Azure, you’ve probably come across terms like resource groups and CLI (learn about Microsoft CLI in detail here). They might sound technical at first, but the concepts are actually pretty straightforward. Let’s walk through them in a simple way.

Getting Set Up

Before doing anything, make sure you have:

  • Azure CLI installed – this lets you manage Azure directly from your command line instead of using the web portal.
  • An active login session – once installed, sign in so you can start working with your Azure resources.

Understanding Resource Groups

Think of a resource group like a folder where you keep related items together.

For example, if you’re building a web application, you might have:

  • A database
  • Storage
  • An app service

Instead of managing each separately, you place them all in one resource group.

A good practice is to group resources that are used together and will likely be updated or removed at the same time. This keeps everything organized and easier to manage.

One important note:
When creating a resource group, you’ll choose a location. This location is not where your actual resources run, it’s where Azure keeps the metadata (information about your resources). This can be important for compliance or data governance.

Creating a Resource Group

You can create a resource group with a single command:

az group create –name demoResourceGroup –location westus

Just specify a name and a region, and Azure will handle the rest.

Checking Your Resource Groups

To see all resource groups in your account:

az group list

If you want details for a specific group:

az group show –name exampleGroup

Removing a Resource Group

When a project is no longer needed, you can delete the entire group:

az group delete –name exampleGroup

Be careful here, as deleting a resource group removes everything inside it. There’s no undo, so make sure you’re targeting the correct group.

Adding Resources

A resource group becomes useful when you start adding services to it. Here’s an example of creating a storage account:

az storage account create \
–resource-group exampleGroup \
–name examplestore \
–location westus \
–sku Standard

Keep in mind that storage account names must be unique across all of Azure, so you may need to adjust your naming if it’s already taken.

The Takeaway

You don’t need to click around the Azure portal for hours. A few CLI commands and you’re managing resource groups like a pro. Group related stuff together, keep track of what you have, and clean up when you’re done. Simple as that.

Scroll to Top