Modifier

Partager via


Set-AzServiceBusSubscription

Updates a ServiceBus Subscription

Syntax

Set-AzServiceBusSubscription
   -Name <String>
   -TopicName <String>
   -NamespaceName <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   [-AutoDeleteOnIdle <TimeSpan>]
   [-DefaultMessageTimeToLive <TimeSpan>]
   [-DuplicateDetectionHistoryTimeWindow <TimeSpan>]
   [-LockDuration <TimeSpan>]
   [-EnableBatchedOperations]
   [-Status <String>]
   [-ForwardTo <String>]
   [-ForwardDeadLetteredMessagesTo <String>]
   [-MaxDeliveryCount <Int32>]
   [-DeadLetteringOnFilterEvaluationException]
   [-DeadLetteringOnMessageExpiration]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzServiceBusSubscription
   -InputObject <IServiceBusIdentity>
   [-AutoDeleteOnIdle <TimeSpan>]
   [-DefaultMessageTimeToLive <TimeSpan>]
   [-DuplicateDetectionHistoryTimeWindow <TimeSpan>]
   [-LockDuration <TimeSpan>]
   [-EnableBatchedOperations]
   [-Status <String>]
   [-ForwardTo <String>]
   [-ForwardDeadLetteredMessagesTo <String>]
   [-MaxDeliveryCount <Int32>]
   [-DeadLetteringOnFilterEvaluationException]
   [-DeadLetteringOnMessageExpiration]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Updates a ServiceBus Subscription

Examples

Example 1: Update a ServiceBus subscription

Set-AzServiceBusSubscription -ResourceGroupName myResourceGroup -NamespaceName myNamespace -TopicName myTopic -Name mySubscription -DefaultMessageTimeToLive (New-TimeSpan -Days 10) -EnableBatchedOperations

AccessedAt                                : 1/1/0001 12:00:00 AM
AutoDeleteOnIdle                          : 10675199.02:48:05.4775807
ClientId                                  :
CountDetailActiveMessageCount             : 0
CountDetailDeadLetterMessageCount         : 0
CountDetailScheduledMessageCount          : 0
CountDetailTransferDeadLetterMessageCount : 0
CountDetailTransferMessageCount           : 0
CreatedAt                                 : 9/23/2022 2:37:46 PM
DeadLetteringOnFilterEvaluationException  : True
DeadLetteringOnMessageExpiration          : False
DefaultMessageTimeToLive                  : 10.00:00:00
DuplicateDetectionHistoryTimeWindow       :
EnableBatchedOperations                   : True
ForwardDeadLetteredMessagesTo             :
ForwardTo                                 :
Id                                        : /subscriptions/000000000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ServiceBus/namespaces/myNamespace/topics/myTopic/subscriptions/mySubscription
IsClientAffine                            : False
IsDurable                                 :
IsShared                                  :
Location                                  : westus
LockDuration                              : 00:01:00
MaxDeliveryCount                          : 10
MessageCount                              : 0
Name                                      : testsub
RequiresSession                           : False
ResourceGroupName                         : myResourceGroup
Status                                    : Active

Updates DefaultMessageTimeToLive and EnableBatchedOperations ServiceBus subscription mySubscription under topic myTopic.

Example 1: Update a ServiceBus subscription using InputObject parameter set

$subscription = Get-AzServiceBusSubscription -ResourceGroupName myResourceGroup -NamespaceName myNamespace -TopicName myTopic -Name mySubscription
Set-AzServiceBusSubscription -InputObject $subscription -DefaultMessageTimeToLive (New-TimeSpan -Days 10) -EnableBatchedOperations

AccessedAt                                : 1/1/0001 12:00:00 AM
AutoDeleteOnIdle                          : 10675199.02:48:05.4775807
ClientId                                  :
CountDetailActiveMessageCount             : 0
CountDetailDeadLetterMessageCount         : 0
CountDetailScheduledMessageCount          : 0
CountDetailTransferDeadLetterMessageCount : 0
CountDetailTransferMessageCount           : 0
CreatedAt                                 : 9/23/2022 2:37:46 PM
DeadLetteringOnFilterEvaluationException  : True
DeadLetteringOnMessageExpiration          : False
DefaultMessageTimeToLive                  : 10.00:00:00
DuplicateDetectionHistoryTimeWindow       :
EnableBatchedOperations                   : True
ForwardDeadLetteredMessagesTo             :
ForwardTo                                 :
Id                                        : /subscriptions/000000000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ServiceBus/namespaces/myNamespace/topics/myTopic/subscriptions/mySubscription
IsClientAffine                            : False
IsDurable                                 :
IsShared                                  :
Location                                  : westus
LockDuration                              : 00:01:00
MaxDeliveryCount                          : 10
MessageCount                              : 0
Name                                      : testsub
RequiresSession                           : False
ResourceGroupName                         : myResourceGroup
Status                                    : Active

Updates DefaultMessageTimeToLive and EnableBatchedOperations ServiceBus subscription mySubscription under topic myTopic using InputObject parameter set.

Parameters

-AsJob

Run the command as a job

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AutoDeleteOnIdle

ISO 8061 timeSpan idle interval after which the subscription is automatically deleted. The minimum duration is 5 minutes.

Type:TimeSpan
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DeadLetteringOnFilterEvaluationException

Value that indicates whether a subscription has dead letter support on filter evaluation exceptions.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DeadLetteringOnMessageExpiration

Value that indicates whether a subscription has dead letter support when a message expires.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultMessageTimeToLive

ISO 8601 default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.

Type:TimeSpan
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DuplicateDetectionHistoryTimeWindow

ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.

Type:TimeSpan
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableBatchedOperations

Value that indicates whether server-side batched operations are enabled.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ForwardDeadLetteredMessagesTo

Queue/Topic name to forward the Dead Letter message

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ForwardTo

Queue/Topic name to forward the messages

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Identity parameter. To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Type:IServiceBusIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-LockDuration

ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute.

Type:TimeSpan
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MaxDeliveryCount

The maximum delivery count. A message is automatically deadlettered after this number of deliveries. default value is 10.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the Subscription.

Type:String
Aliases:SubscriptionName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NamespaceName

The name of ServiceBus namespace

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

-NoWait

Run the command asynchronously

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group. The name is case insensitive.

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

-Status

Enumerates the possible values for the status of a messaging entity.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TopicName

The name of the Topic.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
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:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

IServiceBusIdentity

Outputs

ISbSubscription