< Back
Get-AzureRmApiManagementSubscription
Post
NAME Get-AzureRmApiManagementSubscription
SYNOPSIS
Gets subscriptions.
SYNTAX
Get-AzureRmApiManagementSubscription -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-ProductId <String>]
[<CommonParameters>]
Get-AzureRmApiManagementSubscription -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-SubscriptionId <String>]
[<CommonParameters>]
Get-AzureRmApiManagementSubscription -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-UserId <String>]
[<CommonParameters>]
DESCRIPTION
The Get-AzureRmApiManagementSubscription cmdlet gets a specified subscription, or all subscriptions, if no subscription is specified.
PARAMETERS
-Context <PsApiManagementContext>
Specifies a PsApiManagementContext object.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ProductId <String>
Specifies a product identifier. If specified, this cmdlet finds all subscriptions by the product identifier.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-SubscriptionId <String>
Specifies a subscription identifier. If specified, this cmdlet finds subscription by the identifier.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-UserId <String>
Specifies a user identifier. If specified, this cmdlet finds all subscriptions by the user identifier.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscription
The detail of the subscription in the API Management service.
IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscription>
The list of subscription in API Management service.
NOTES
Example 1: Get all subscriptions
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Get-AzureRmApiManagementSubscription -Context $apimContext
This command gets all subscriptions.
Example 2: Get a subscription with a specified ID
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Get-AzureRmApiManagementSubscription -Context $apimContext -SubscriptionId "0123456789"
This command gets a subscription by ID.
Example 3: Get all subscriptions for a user
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Get-AzureRmApiManagementSubscription -Context $apimContext -UserId "777"
This command gets a user's subscriptions.
Example 4: Get all subscriptions for a product
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Get-AzureRmApiManagementSubscription -Context $apimContext -ProductId "999"
This command gets all subscriptions for the product.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... bscription
New-AzureRmApiManagementSubscription
Remove-AzureRmApiManagementSubscription
Set-AzureRmApiManagementSubscription
SYNOPSIS
Gets subscriptions.
SYNTAX
Get-AzureRmApiManagementSubscription -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-ProductId <String>]
[<CommonParameters>]
Get-AzureRmApiManagementSubscription -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-SubscriptionId <String>]
[<CommonParameters>]
Get-AzureRmApiManagementSubscription -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-UserId <String>]
[<CommonParameters>]
DESCRIPTION
The Get-AzureRmApiManagementSubscription cmdlet gets a specified subscription, or all subscriptions, if no subscription is specified.
PARAMETERS
-Context <PsApiManagementContext>
Specifies a PsApiManagementContext object.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ProductId <String>
Specifies a product identifier. If specified, this cmdlet finds all subscriptions by the product identifier.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-SubscriptionId <String>
Specifies a subscription identifier. If specified, this cmdlet finds subscription by the identifier.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-UserId <String>
Specifies a user identifier. If specified, this cmdlet finds all subscriptions by the user identifier.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscription
The detail of the subscription in the API Management service.
IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscription>
The list of subscription in API Management service.
NOTES
Example 1: Get all subscriptions
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Get-AzureRmApiManagementSubscription -Context $apimContext
This command gets all subscriptions.
Example 2: Get a subscription with a specified ID
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Get-AzureRmApiManagementSubscription -Context $apimContext -SubscriptionId "0123456789"
This command gets a subscription by ID.
Example 3: Get all subscriptions for a user
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Get-AzureRmApiManagementSubscription -Context $apimContext -UserId "777"
This command gets a user's subscriptions.
Example 4: Get all subscriptions for a product
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Get-AzureRmApiManagementSubscription -Context $apimContext -ProductId "999"
This command gets all subscriptions for the product.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... bscription
New-AzureRmApiManagementSubscription
Remove-AzureRmApiManagementSubscription
Set-AzureRmApiManagementSubscription