Set-AzureRmServiceBusSubscription
Updates a subscription description for a Service Bus topic in the specified Service Bus namespace.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
Set-AzureRmServiceBusSubscription
[-ResourceGroupName] <String>
[-Namespace] <String>
[-Topic] <String>
[-InputObject] <PSSubscriptionAttributes>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-AzureRmServiceBusSubscription cmdlet updates the description of the subscription for the Service Bus topic in the specified Service Bus namespace.
Examples
Example 1
PS C:\> $subscriptionObj = Get-AzureRmServiceBusSubscription -ResourceGroup Default-ServiceBus-WestUS -NamespaceName SB-Example1 -TopicName SB-Topic_exampl1 -SubscriptionName SB-TopicSubscription-Example1
PS C:\> $subscriptionObj.DeadLetteringOnMessageExpiration = $True
PS C:\> $subscriptionObj.MaxDeliveryCount = 9
Name : SB-TopicSubscription-Example1
AccessedAt : 1/1/0001 12:00:00 AM
AutoDeleteOnIdle : 10675199.02:48:05.4775807
CountDetails :
CreatedAt : 1/20/2017 9:59:15 PM
DefaultMessageTimeToLive : 10675199.02:48:05.4775807
DeadLetteringOnMessageExpiration : True
EnableBatchedOperations : True
LockDuration : 00:01:00
MaxDeliveryCount : 9
MessageCount : 0
RequiresSession : False
Status : Active
UpdatedAt : 1/20/2017 9:59:15 PM
PS C:\> Set-AzureRmServiceBusSubscription -ResourceGroup Default-ServiceBus-WestUS -NamespaceName SB-Example1 -TopicName SB-Topic_exampl1 -SubscriptionObj $subscriptionObj
Updates the description for the specified subscription to the given topic. This example updates the DeadLetteringOnMessageExpiration property to true and MaxDeliveryCount to 9.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
ServiceBus Subscription definition.
Type: | PSSubscriptionAttributes |
Aliases: | SubscriptionObj |
Position: | 3 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Namespace
Namespace Name.
Type: | String |
Aliases: | NamespaceName |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
The name of the resource group
Type: | String |
Aliases: | ResourceGroup |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Topic
Topic Name.
Type: | String |
Aliases: | TopicName |
Position: | 2 |
Default value: | None |
Required: | True |
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 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Parameters: InputObject (ByValue)