azure,

Manage Azure subscriptions

Sep 26, 2019 · 1 min read · Post a comment
Manage Azure subscriptions

Azure subscriptions are used for deploying and consuming Azure resources. A single Azure account can have multiple subscriptions, but there are some limitations. You can combine multiple Azure resources into a single Azure Resource Group. These groups are managed by Azure Resource Manager.
According to Microsoft, there are two Subscription limits tables: Subscription limits and Subscription limits - Azure Resource Manager.
You can check the tables on the following link: Azure subscription and service limits, quotas, and constraints.

Prerequisites

  • Azure account
  • Azure CLI

Configuration

Step 1. Open Terminal and list the active subscriptions:

az account list --output table

It will list all available subscriptions in a table format. You can output the results with other formats like: json, jsonc, yaml, and tsv.

Step 2. Run a command to change the subscription.

az account set --subscription <SubscriptionId>

Replace the part with the actual subscription id.

Check default subscription

It’s always a good practice to check which subscription we are using before managing the Azure resources. There are a couple of ways to do this:

1. With az account show command:

az account show --output jsonc

Terminal AZ Subscription

When using show command, it will display the current subscription with every output format except table.

2. With az account list command:

az account list --output table

Terminal AZ Subscription1

Official documentation: Use multiple Azure subscriptions.

Join Newsletter
Get the latest news right in your inbox. We never spam!