
To view your current active Azure subscription, you can check the Azure portal.
The Azure portal is where you can manage all your Azure resources, including your subscriptions.
To access the Azure portal, simply navigate to portal.azure.com in your web browser.
Once you're logged in, click on the profile picture or icon in the top right corner and select "Subscriptions" from the dropdown menu.
For another approach, see: Azure Move Resource Group to Another Subscription
Managing Azure Subscriptions
To manage your Azure Subscriptions, you first need to know the details of your subscriptions, such as the id or name.
The az account list command will return a JSON output containing information about all your Azure Subscriptions, including the tenantId of Azure AD, the user you're logged in with, and the cloudName.
You can see the JSON output contains a few different values, but only the name and id are necessary for verifying and setting which Azure Subscription you want to run Azure CLI commands against.
You might like: Azure Auth Json Website Azure Ad Authentication

To list all your Azure Subscriptions, run the az account list command in the terminal.
Once you know which Azure Subscription you need to scope the Azure CLI context to, you will set the Azure CLI to use that subscription with the az account set command.
Be sure to replace the placeholders in the command with the actual id or name for the Azure Subscription you wish to target.
If the az account set command executed successfully, the terminal will not return a response, so it's essential to run the az account show command afterwards to verify the Azure CLI is set to the correct subscription.
If there is an error setting the Azure CLI to a specific subscription, an error message will be returned, indicating that the specified subscription does not exist.
Worth a look: Set Subscription Context Azure Powershell
Changing Subscription Settings
You can change the active subscription in Azure using the az account set command, specifying the desired subscription ID or name.
To switch to a different subscription, you'll need to know its ID or name, which can be found in the Azure portal.
If you're changing to a subscription in a different tenant, you'll also be changing the active tenant.
To add a new subscription to your Microsoft Entra tenant, see the instructions on Associate or add an Azure subscription to your Microsoft Entra tenant.
If you encounter a "The subscription of ... doesn't exist..." error, check the Troubleshooting section for possible solutions.
For more insights, see: Create Tenant Azure
Set Subscription Target
To set the Azure CLI to use a specific subscription, you'll need to run the az account set command. This command allows you to explicitly tell the Azure CLI which subscription you want to target.
You can set the Azure CLI to use a subscription by specifying its ID or name. For example, if you want to set the Azure CLI to use a subscription with the ID '12345678-1234-1234-1234-123456789012', you would run the command: az account set --subscription '12345678-1234-1234-1234-123456789012'.
Worth a look: Azure Cli vs Azure Powershell
Alternatively, you can set the Azure CLI to use a subscription by specifying its name. If you want to set the Azure CLI to use a subscription with the name 'My Subscription', you would run the command: az account set --subscription 'My Subscription'.
To verify that the Azure CLI is set to the correct subscription, run the az account show command. This command will display a JSON response with information about the subscription the Azure CLI is currently set to work with.
If you receive an error message when trying to set the Azure CLI to a specific subscription, it may be because the subscription does not exist. In this case, you can try running the az account list command to see a list of all the subscriptions you have access to.
Consider reading: Azure Cli Set Subscription
Frequently Asked Questions
How do I see active services in Azure?
To view active services in Azure, sign in to the Azure portal and navigate to Service Health in the All services menu. This will provide you with information on services that are currently available for any subscription you have access to.
Featured Images: pexels.com


