How Can I get all subscriptions within a specific tenant in azure CLI

Yuval Shmaryahu 6 Reputation points
2021-01-07T13:49:07.397+00:00

Can anyone make a suggestion?

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,289 questions
{count} votes

1 answer

Sort by: Most helpful
  1. BhargaviAnnadevara-MSFT 5,466 Reputation points
    2021-01-11T12:19:47.877+00:00

    @Yuval Shmaryahu You can achieve this with the account extension provided by Azure CLI. Here is the extension reference: account

    The az account tenant list command lists all the tenants that are authorized for your account.

    Likewise, the az account subscription list gets all the subscriptions for a tenant.

    You can also explore the Azure PowerShell alternatives for the same: Get-AzTenant and Get-AzSubscription. (It becomes a tad more flexible with PowerShell as you can pass the Tenant ID with the -TenantId parameter while fetching Subscriptions).