Get-VBRAzureSubscription

In this article

    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 2 parameter sets.

    • For looking for subscriptions by the subscriptions name:

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

    • For looking for 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

    Required

    Position

    Accept
    Pipeline
    Input

    Accept
    Wildcard
    Characters

    Account

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

    True

    Named

    True (ByValue,
    ByProperty
    Name)

    False

    Name

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

    False

    Named

    False

    True

    Id

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

    False

    Named

    False

    False

    <CommonParameters>

    This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.

    Return Type

    VBRAzureSubscription

    Example 1

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

    1. Run Get-VBRAzureAccount to get the account. Save it to the $account variable.
    2. Run Get-VBRAzureSubscription with the $account variable.

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

    Get-VBRAzureSubscription -Account $account

    Example 2

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

    1. Run Get-VBRAzureAccount to get the account. Save it to the $account variable.
    2. Run Get-VBRAzureSubscription with the $account variable. Specify the name of the subscription you want to get.

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

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

    Example 3

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

    1. Run Get-VBRAzureAccount to get the account. Save it to the $account variable.
    2. Run Get-VBRAzureSubscription with the $account variable. Pass the result to the Where-Object cmdlet to select the subscribtions with the Id property that equals "f482cd54-454d-419f-9ec2-f388796091f9".

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

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

    Related Commands

    Get-VBRAzureAccount