Set-​Azure​Rm​Api​Management​Subscription

Sets existing subscription details.

Syntax

Set-AzureRmApiManagementSubscription
   -Context <PsApiManagementContext>
   [-ExpiresOn <DateTime>]
   [-Name <String>]
   [-PassThru]
   [-PrimaryKey <String>]
   [-SecondaryKey <String>]
   [-State <PsApiManagementSubscriptionState>]
   [-StateComment <String>]
   -SubscriptionId <String>
   [<CommonParameters>]

Description

The Set-AzureRmApiManagementSubscription cmdlet sets existing subscription details.

Examples

Example 1: Set the state and primary and secondary keys for a subscription

PS C:\>Set-AzureRmApiManagementSubscription -Context $apimContext -SubscriptionId -0123456789 -PrimaryKey "80450f7d0b6d481382113073f67822c1" -SencondaryKey "97d6112c3a8f48d5bf0266b7a09a761c" -State "Active"

This command sets the primary and secondary keys for a subscription and activates it.

Required Parameters

-Context

Specifies a PsApiManagementContext object.

Type:PsApiManagementContext
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SubscriptionId

Specifies the subscription ID.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ExpiresOn

Specifies a subscription expiration date. The default value of this parameter is $Null.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies a subscription name.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PassThru

passthru

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PrimaryKey

Specifies the subscription primary key. This parameter is generated automatically if not specified. This parameter must be 1 to 300 characters long.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SecondaryKey

Specifies the subscription secondary key. This parameter is generated automatically if not specified. This parameter must be 1 to 300 characters long.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-State

Specifies the subscription state. The default value of this parameter is $Null.

Type:PsApiManagementSubscriptionState
Parameter Sets:Suspended, Active, Expired, Submitted, Rejected, Cancelled
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-StateComment

Specifies the subscription state comment. The default value of this parameter is $Null.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Outputs

Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscripition