Azure Getting Started: Subscriptions, Resource Groups, and the Azure CLI
Introduction
Azure organizes everything into a hierarchy, and understanding it explains most of how permissions, billing, and cleanup work. This lesson covers that structure, installs the Azure CLI, creates a resource group, and shows the simplest and safest way to clean up: delete the group.
Prerequisites
- A Microsoft account to create an Azure account
- The cost management lesson recommended
Step-by-Step Guide
Step 1: Learn the Azure hierarchy
Your identities live in a Microsoft Entra ID tenant. Subscriptions are the billing and access boundary, and you create resources inside one. Within a subscription, resource groups are logical containers that hold related resources, such as everything for one project. Optional management groups sit above subscriptions to apply policies across several. Every resource belongs to exactly one resource group.
Step 2: Set up the account and a budget
Create an Azure account and open the Azure portal. In Cost Management, create a budget on your subscription with email alerts at several thresholds before you create resources. Free account terms and credits change, so read the current offer shown for your account.
Step 3: Install the CLI and sign in
Install the Azure CLI from Microsoft's documentation, then sign in. The login command opens a browser. Afterward, show the active subscription, and if you have several, set the one you want.
az --version
az login
az account show --output table
az account list --output table
az account set --subscription "YOUR_SUBSCRIPTION_NAME_OR_ID"Step 4: Create a resource group with tags
A resource group needs a name and a location. Tags help you track ownership and spot leftovers. Pick a region close to you that offers the services you need.
az group create \
--name rg-demo \
--location westeurope \
--tags project=calibertek-demo owner=your-name environment=dev
az group list --output tableStep 5: Clean up by deleting the group
Deleting a resource group deletes every resource inside it, which makes it the simplest way to clean up after a lab. It is irreversible, so confirm the name carefully. The no-wait option returns immediately while Azure removes the group in the background.
az group delete --name rg-demo --yes --no-waitFAQs
- Why put resources in a resource group per project?
- It gives you one place to see, tag, secure, and delete everything that belongs together, and deleting the group guarantees nothing is left behind and billing.
- What is the difference between a subscription and a tenant?
- The tenant is your Entra ID directory of users and apps. A subscription is where resources are created and billed. One tenant can have many subscriptions.
Summary
Azure is organized as tenant, subscription, resource group, and resource. Sign in with az login, group related resources in a tagged resource group, and delete the group to clean up everything at once.
Related tutorials
- Google Cloud Storage Basics: Buckets, Objects, and Access Control
- Google Cloud Getting Started: Projects, IAM, and the gcloud CLI
- Azure Blob Storage Basics: Accounts, Containers, and Secure Access
- Amazon S3 Basics: Buckets, Objects, Versioning, and Safe Sharing
- AWS Getting Started: Secure Your Account, Set Up Access, and Use the CLI
Comments
Log in or create a free account to join the discussion.