5

Using one session of an azure sandbox which lasts for 4 hours. Once one session gets expired, I've created a new sandbox to continue practicing exercises from the Azure portal. After execuing command: az account set --subscription "Concierge Subscription" I am getting below error:

enter image description here

However, In Azure portal there is just one "Concierge Subscription". How can I close other subscription of the same name?

Bhargavi Annadevara
  • 4,923
  • 2
  • 13
  • 30
CIndolia
  • 51
  • 2

2 Answers2

6

I think is it just the local cache of AZ cli that is not refreshed. The new subscriptions keeps adding, without removing the expired one. Run az account list --refresh, this will remove the expired ones.

Sarye Haddadi
  • 6,346
  • 2
  • 13
  • 12
2

The --subscription parameter accepts either the Name or ID of a given subscription.

You can get navigate to Subscriptions blade on Azure Portal to get the Subscription ID of the current active Sandbox subscription, and then set that subscription to be the current active subscription using:

az account set -s <subscription-id>

Azure CLI Command reference: az account

Bhargavi Annadevara
  • 4,923
  • 2
  • 13
  • 30