Remove-AzApiManagementSubscription

Deletes an existing subscription.

Syntax

Remove-AzApiManagementSubscription
      -Context <PsApiManagementContext>
      -SubscriptionId <String>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzApiManagementSubscription
      -Context <PsApiManagementContext>
      -SubscriptionId <String>
      -InputObject <PsApiManagementSubscription>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzApiManagementSubscription
      -Context <PsApiManagementContext>
      -SubscriptionId <String>
      -ResourceId <String>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-AzApiManagementSubscription cmdlet deletes an existing subscription.

Examples

Example 1: Delete a subscription

PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Remove-AzApiManagementSubscription -Context $apimContext -SubscriptionId "0123456789" -Force

This command deletes an existing subscription.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Context

Specifies a PsApiManagementContext object.

Type:PsApiManagementContext
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Instance of PsApiManagementSubscription. This parameter is required.

Type:PsApiManagementSubscription
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-PassThru

Indicates that this cmdlet returns a value of $True, if it succeeds, or a value of $false, otherwise.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ResourceId

Arm ResourceId of Subscription. This parameter is required.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-SubscriptionId

Specifies the subscription ID.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PsApiManagementContext

String

SwitchParameter

Outputs

Boolean