Get-AzSubscription

Get-AzSubscription cmdlet retrieves subscriptions.

Syntax

Get-AzSubscription [-SubscriptionIds <Guid[]>] [-TenantId <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]

Description

The Get-AzSubscription cmdlet retrieves the subscriptions for the current user or service principal. You can filter subscriptions by ID or Tenant ID.

Parameters

Name Description Type
-SubscriptionIds Specifies the IDs of the subscriptions to retrieve. Guid[]
-TenantId Specifies the Tenant ID of the subscriptions to retrieve. String
-DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. IAzureContextContainer
<CommonParameters> This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, OutVariable. To get the list of the common parameters, type: Get-Help commonparameter. System.Management.Automation.PSObject

Examples

Example 1: Get all subscriptions for the current user.

Get-AzSubscription

Example 2: Get a specific subscription by ID.

Get-AzSubscription -SubscriptionIds "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Example 3: Get all subscriptions for a specific tenant.

Get-AzSubscription -TenantId "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"

Input Details

None

Output Details

Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels.AzureSubscription

Related Links