Get-VBRAzureSubscription

Short Description

Returns subscriptions associated with a Microsoft Azure account.

Applies to

Platform: VMware, Hyper-V

Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License

Syntax

This cmdlet provides parameter sets that allow you to:

  • Get subscriptions by the subscriptions name.

Get-VBRAzureSubscription -Account <VBRAzureAccount> [-Name <string[]>]  [<CommonParameters>]

  • Get subscriptions by the subscriptions ID.

Get-VBRAzureSubscription -Account <VBRAzureAccount> [-Id <guid[]>]  [<CommonParameters>]

Detailed Description

This cmdlet returns subscriptions associated with a selected Microsoft Azure account.

Important

This cmdlet does not support Microsoft Azure accounts with the Azure Service Manager type of a subscription (ASM, also known as a "classic" type subscription).

Parameters

Parameter

Description

Type

Required

Position

Accept
Pipeline
Input

Account

Specifies the account. The cmdlet will return subscriptions associated with this account.

Accepts the VBRAzureAccount object. Run the Get-VBRAzureAccount cmdlet to get this object.

True

Named

True (ByValue,
ByProperty
Name)

Name

Specifies the array of names of the subscriptions you want to get.

String[]

False

Named

False

Id

Specifies the array of IDs of the subscriptions you want to get.

Guid[]

False

Named

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.

Output Object

VBRAzureSubscription

Examples

Get-VBRAzureSubscriptionExample 1. Getting All Subscriptions for Microsoft Azure Account

This example shows how to get all subscriptions associated with an account.

$account = Get-VBRAzureAccount -Type ResourceManager -Name "RestoreToAzureRM@Veeam.com"

Get-VBRAzureSubscription -Account $account

Perform the following steps:

  1. Run the Get-VBRAzureAccount cmdlet. Set the ResourceManager value as the Type parameter value. Specify the Name parameter value. Save it to the $account variable.
  2. Run the Get-VBRAzureSubscription cmdlet. Set the $account variable as the Account parameter value.

Get-VBRAzureSubscriptionExample 2. Getting Subscription by Name

This example shows how to get a subscription by the subscription name.

$account = Get-VBRAzureAccount -Type ResourceManager -Name "RestoreToAzureRM@Veeam.com"

$subscription = Get-VBRAzureSubscription -Account $account -Name "VeeamDirectRestore2Azure"

Perform the following steps:

  1. Run the Get-VBRAzureAccount cmdlet. Set the ResourceManager value as the Type parameter value. Specify the Name parameter value. Save it to the $account variable.
  2. Run the Get-VBRAzureSubscription cmdlet. Set the $account variable as the Account parameter value. Specify the Name parameter value. Save it to the $subscription variable.

Get-VBRAzureSubscriptionExample 3. Getting Subscription by ID

This example shows how to get a subscription by the subscription ID.

$account = Get-VBRAzureAccount -Type ResourceManager -Name "RestoreToAzureRM@Veeam.com"

Get-VBRAzureSubscription -Account $account | Where-Object Id -eq "f482cd54-454d-419f-9ec2-f388796091f9"

Perform the following steps:

  1. Run the Get-VBRAzureAccount cmdlet. Set the ResourceManager value as the Type parameter value. Specify the Name parameter value. Save it to the $account variable.
  2. Run the Get-VBRAzureSubscription cmdlet. Set the $account variable as the Account parameter value. Pass the result to the Where-Object cmdlet to select the subscriptions with the Id property that equals f482cd54-454d-419f-9ec2-f388796091f9.

Related Commands

Get-VBRAzureAccount

Page updated 12/13/2023

Page content applies to build 12.2.0.334