New-AzServiceBusSubscription
create a topic subscription.
Syntax
CreateExpanded (Default)
New-AzServiceBusSubscription
-Name <String>
-NamespaceName <String>
-ResourceGroupName <String>
-TopicName <String>
[-SubscriptionId <String>]
[-AutoDeleteOnIdle <TimeSpan>]
[-ClientId <String>]
[-DeadLetteringOnFilterEvaluationException]
[-DeadLetteringOnMessageExpiration]
[-DefaultMessageTimeToLive <TimeSpan>]
[-DuplicateDetectionHistoryTimeWindow <TimeSpan>]
[-EnableBatchedOperations]
[-ForwardDeadLetteredMessagesTo <String>]
[-ForwardTo <String>]
[-IsClientAffine]
[-IsDurable]
[-IsShared]
[-LockDuration <TimeSpan>]
[-MaxDeliveryCount <Int32>]
[-RequiresSession]
[-Status <String>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
CreateViaIdentityNamespaceExpanded
New-AzServiceBusSubscription
-Name <String>
-TopicName <String>
-NamespaceInputObject <IServiceBusIdentity>
[-AutoDeleteOnIdle <TimeSpan>]
[-ClientId <String>]
[-DeadLetteringOnFilterEvaluationException]
[-DeadLetteringOnMessageExpiration]
[-DefaultMessageTimeToLive <TimeSpan>]
[-DuplicateDetectionHistoryTimeWindow <TimeSpan>]
[-EnableBatchedOperations]
[-ForwardDeadLetteredMessagesTo <String>]
[-ForwardTo <String>]
[-IsClientAffine]
[-IsDurable]
[-IsShared]
[-LockDuration <TimeSpan>]
[-MaxDeliveryCount <Int32>]
[-RequiresSession]
[-Status <String>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
CreateViaIdentityNamespace
New-AzServiceBusSubscription
-Name <String>
-TopicName <String>
-NamespaceInputObject <IServiceBusIdentity>
-Parameter <ISbSubscription>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
CreateViaIdentityTopicExpanded
New-AzServiceBusSubscription
-Name <String>
-TopicInputObject <IServiceBusIdentity>
[-AutoDeleteOnIdle <TimeSpan>]
[-ClientId <String>]
[-DeadLetteringOnFilterEvaluationException]
[-DeadLetteringOnMessageExpiration]
[-DefaultMessageTimeToLive <TimeSpan>]
[-DuplicateDetectionHistoryTimeWindow <TimeSpan>]
[-EnableBatchedOperations]
[-ForwardDeadLetteredMessagesTo <String>]
[-ForwardTo <String>]
[-IsClientAffine]
[-IsDurable]
[-IsShared]
[-LockDuration <TimeSpan>]
[-MaxDeliveryCount <Int32>]
[-RequiresSession]
[-Status <String>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
CreateViaIdentityTopic
New-AzServiceBusSubscription
-Name <String>
-TopicInputObject <IServiceBusIdentity>
-Parameter <ISbSubscription>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
create a topic subscription.
Examples
Example 1: Create a new ServiceBus subscription
New-AzServiceBusSubscription -ResourceGroupName myResourceGroup -NamespaceName myNamespace -TopicName myTopic -Name mySubscription -DefaultMessageTimeToLive (New-TimeSpan -Days 6) -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 : 6.00:00:00
DuplicateDetectionHistoryTimeWindow :
EnableBatchedOperations : True
ForwardDeadLetteredMessagesTo :
ForwardTo :
Id : /subscriptions/326100e2-f69d-4268-8503-075374f62b6e/resourceGroups/damorg/providers/Microsoft.ServiceBus/namespaces/testlatests
bmsi/topics/a/subscriptions/testsub
IsClientAffine : False
IsDurable :
IsShared :
Location : westus
LockDuration : 00:01:00
MaxDeliveryCount : 10
MessageCount : 0
Name : testsub
RequiresSession : False
ResourceGroupName : damorg
Status : Active
Creates a new ServiceBus subscription mySubscription
under topic myTopic
.
Parameters
-AutoDeleteOnIdle
Idle interval after which the queue is automatically deleted.
The minimum duration is 5 minutes.
Parameter properties
Type: TimeSpan
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ClientId
Indicates the Client ID of the application that created the client-affine subscription.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DeadLetteringOnFilterEvaluationException
Value that indicates whether a subscription has dead letter support on filter evaluation exceptions.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DeadLetteringOnMessageExpiration
Value that indicates whether a subscription has dead letter support when a message expires.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultMessageTimeToLive
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.
Parameter properties
Type: TimeSpan
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The DefaultProfile parameter is not functional.
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
Parameter properties
Type: PSObject
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzureRMContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DuplicateDetectionHistoryTimeWindow
Defines the duration of the duplicate detection history.
The default value is 10 minutes.
Parameter properties
Type: TimeSpan
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-EnableBatchedOperations
Value that indicates whether server-side batched operations are enabled.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ForwardDeadLetteredMessagesTo
Queue/Topic name to forward the Dead Letter message
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ForwardTo
Queue/Topic name to forward the messages
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IsClientAffine
Value that indicates whether the subscription has an affinity to the client id.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IsDurable
For client-affine subscriptions, this value indicates whether the subscription is durable or not.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IsShared
For client-affine subscriptions, this value indicates whether the subscription is shared or not.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LockDuration
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.
Parameter properties
Type: TimeSpan
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-MaxDeliveryCount
Number of maximum deliveries.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
The subscription name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: SubscriptionName
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Identity Parameter
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespace
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-NamespaceName
The namespace name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Parameter
Description of subscription resource.
Parameter properties
Type: ISbSubscription
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateViaIdentityNamespace
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopic
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-RequiresSession
Value indicating if a subscription supports the concept of sessions.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
Name of the Resource group within the Azure subscription.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Status
Enumerates the possible values for the status of a messaging entity.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-SubscriptionId
Subscription credentials that uniquely identify a Microsoft Azure subscription.
The subscription ID forms part of the URI for every service call.
Parameter properties
Type: String
Default value: (Get-AzContext).Subscription.Id
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Identity Parameter
CreateViaIdentityTopicExpanded
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityTopic
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-TopicName
The topic name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespaceExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaIdentityNamespace
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs