az cli list all subscriptions

Azure CLI: List All Subscriptions

By Rachel Lee
AD

The Azure CLI (Azure Command-Line Interface) is a powerful tool that enables users to manage Azure resources from the command line or in scripts. One of the essential tasks you might perform with the Azure CLI is listing all your subscriptions. This command is useful for managing multiple subscriptions, tracking usage, and ensuring you're working in the correct environment. Let's delve into how to achieve this and explore related commands.

Before we proceed, ensure you've installed the Azure CLI on your local machine or the remote server you're using. You can download it from the official Microsoft documentation. Once installed, log in to your Azure account using the Azure CLI by typing 'az login' in your command prompt or terminal. After a successful login, you're ready to list all your subscriptions.

Listing All Azure Subscriptions

To list all your Azure subscriptions, you use the 'az account list' command in your terminal or command prompt. This command returns a JSON representation of all your Azure subscriptions.

AD
Types of subscription services - infographic
Types of subscription services - infographic
Digital Subscription Hub
Digital Subscription Hub
Too many subscriptions and memberships.
Too many subscriptions and memberships.

However, if you want a cleaner, human-friendly output, you can use 'az account list --query "[].name" --output tsv'. This command will display only the names of your subscriptions in a tab-separated format, making it easier to read.

Viewing Subscription Details

The 'az account list' command provides essential information about your subscriptions, including their names, IDs, and states. If you need more detailed information about a specific subscription, you can use the 'az account show' command followed by the subscription name or ID.

an iphone screenshot with the text'all subcripts'on it
an iphone screenshot with the text'all subcripts'on it
Smart - A month ago I shared a list of subscriptions that drop their price when you start the cancellation process… and people added even more in the comments. After updating everything, the list grew to dozens of services where users confirmed they were offered a discount the moment they hit “cancel.” One name kept coming up. SiriusXM. Many readers reported large discounts, and a clear pattern showed up… the first offer wasn’t the best one. People who declined early offers often unlocked better deals. That’s how the system works. When you try to cancel, you’re flagged as a potential loss. Retention systems are designed to keep you, and they often have room to lower the price. But it’s not guaranteed. Some users reported no discounts at all on certain services, while others saw mix What Month, Money Saving Methods, Financial Organization, Life Management, Productivity Tools, Getting Organized, Apple Tv, First Names, Personal Development
Smart - A month ago I shared a list of subscriptions that drop their price when you start the cancellation process… and people added even more in the comments. After updating everything, the list grew to dozens of services where users confirmed they were offered a discount the moment they hit “cancel.” One name kept coming up. SiriusXM. Many readers reported large discounts, and a clear pattern showed up… the first offer wasn’t the best one. People who declined early offers often unlocked better deals. That’s how the system works. When you try to cancel, you’re flagged as a potential loss. Retention systems are designed to keep you, and they often have room to lower the price. But it’s not guaranteed. Some users reported no discounts at all on certain services, while others saw mix What Month, Money Saving Methods, Financial Organization, Life Management, Productivity Tools, Getting Organized, Apple Tv, First Names, Personal Development
the back side of an antigrativy cli website with icons and text
the back side of an antigrativy cli website with icons and text

For instance, if you want to view details about a subscription named 'MySubscription', you would use the command 'az account show --name MySubscription'. This command will display detailed information about that subscription in a JSON format.

Switching between Azure Subscriptions

While listing all your subscriptions, you might find the need to switch between them. The 'az account set' command allows you to set the default subscription for your Azure CLI session. This command requires you to specify the subscription name or ID.

AD

For example, to switch to a subscription named 'MySubscription', you would use the command 'az account set --subscription MySubscription'. Once you've set your default subscription, you can use it for all subsequent Azure CLI commands without having to specify it every time.

a blue and white poster with the words azure cli commands on it's side
a blue and white poster with the words azure cli commands on it's side
Premium AI & Design Subscriptions (2025 Deals) | ChatGPT Plus, Adobe CC, Canva
Premium AI & Design Subscriptions (2025 Deals) | ChatGPT Plus, Adobe CC, Canva
Website That Helps You Find Words, Aesthetic Writing Websites, Useful Sites For Writers, Tips For Critical Thinking Online, Cybersecurity Job Description, Useful Websites For Writers, Helpful Writing Websites, How To Learn Tech Skills Online, Resume Computer Skills
Website That Helps You Find Words, Aesthetic Writing Websites, Useful Sites For Writers, Tips For Critical Thinking Online, Cybersecurity Job Description, Useful Websites For Writers, Helpful Writing Websites, How To Learn Tech Skills Online, Resume Computer Skills
the different types of web browsers are shown in this screenshote image,
the different types of web browsers are shown in this screenshote image,
Coding
Coding
the back side of a computer screen with words on it
the back side of a computer screen with words on it

Managing Azure Subscriptions

Azure CLI provides several commands for managing subscriptions. These include creating new subscriptions, updating subscription details, and deleting subscriptions. To view a complete list of these commands, you can use 'az account --help' in your terminal or command prompt.

Effective management of Azure subscriptions is crucial for cost control, governance, and operational efficiency. Familiarizing yourself with these commands can greatly simplify your Azure management tasks.

AD

Creating a New Azure Subscription

To create a new Azure subscription, you use the 'az account create' command. This command requires several parameters, including the subscription name, owner object ID, and region. You can learn more about these parameters by using 'az account create --help'.

az cli list all subscriptions
az cli list all subscriptions
an image of a book list with the words follow on it in english and spanish
an image of a book list with the words follow on it in english and spanish
Computer Tools Name List, List All Tools, Tools List, Mobile Tools Name List, Technology Tools Names, Beginner's Guide To Computer Skills, Cybersecurity Tools Guide, Technology Names List, Computer Tools List
Computer Tools Name List, List All Tools, Tools List, Mobile Tools Name List, Technology Tools Names, Beginner's Guide To Computer Skills, Cybersecurity Tools Guide, Technology Names List, Computer Tools List
a list of books that are in the library
a list of books that are in the library
an image of some words that are in the same font and numbers on each page
an image of some words that are in the same font and numbers on each page
the list of books that you can use to read in your book club or library
the list of books that you can use to read in your book club or library
an image of a table with text on it
an image of a table with text on it
the list of books that are available for free
the list of books that are available for free
a list of books that are in front of a white background with the words, list of 20 website where you can read
a list of books that are in front of a white background with the words, list of 20 website where you can read
Premium Digital Subscriptions | IPTV, Netflix, Spotify & More 📺🎵
Premium Digital Subscriptions | IPTV, Netflix, Spotify & More 📺🎵
an image of a list with many things to do in the next few words on it
an image of a list with many things to do in the next few words on it
Premium Subscription
Premium Subscription

For example, to create a new subscription named 'NewSubscription' with 'user@_domain.com' as the owner and 'West Europe' as the region, you would use the command 'az account create --name NewSubscription --owner user@domain.com --location 'West Europe''.

Deleting an Azure Subscription

Deleting an Azure subscription is a permanent action. To delete a subscription, you use the 'az account delete' command followed by the subscription name or ID. Before deleting, ensure you've stopped all the resources in that subscription to avoid incurring unnecessary charges.

AD

For instance, to delete a subscription named 'SubscriptionToDelete', you would use the command 'az account delete --name SubscriptionToDelete'.

As you've seen, Azure CLI provides a robust set of commands for managing Azure subscriptions. By mastering these commands, you can efficiently manage your Azure resources, track usage, and ensure cost-effectiveness. Whether you're a seasoned Azure user or just starting your Azure journey, these commands can significantly enhance your Azure management experience. So, go ahead, harness the power of Azure CLI, and build your Azure empires!

AD