The Az.ServiceBus
PowerShell module version 9.0.0 of Azure PowerShell that would be released in October introduces improvised cmdlets for public use.
These changes are focused towards making the PowerShell use seamless for the end users.
The following example installs the latest version of the Az.ServiceBus
Azure PowerShell module.
Install-Module -Name Az.ServiceBus -Repository PSGallery -Scope CurrentUser
Until Module 8.3.0, -InputObject supports passing an in memory object to additional cmdlet in pipeline. Due to above design, updating resources becomes a multi step approach.
With the new module release, -InputObject parameter set would be changing for a seamless experience.
In contrast to earlier approach, -InputObject would now support object of corresponding input type as well as resource Id directly to the cmdlet. This would make cmdlet usage fairly easy and faster as compared to the old approach.
Below example shows the difference in -InputObject Usage:
Below example shows how to update queue properties on existing service bus namespace with Module version 8.3.0 or older
$QueueObj = Get-AzServiceBusQueue -ResourceGroup Default-ServiceBus-WestUS -NamespaceName SB-Example1 -QueueName SB-Queue_example1
$QueueObj.ForwardTo = "q1"
$QueueObj.ForwardDeadLetteredMessagesTo = "q1"
$QueueObj.DefaultMessageTimeToLive = "P1YT3H11M2S"
Set-AzServiceBusQueue -ResourceGroup Default-ServiceBus-WestUS -NamespaceName SB-Example1 -QueueName SB-Queue_example1 -InputObject $QueueObj
Below example shows how to update queue properties starting with / after Module version 9.0.0
$queue = Get-AzServiceBusQueue -InputObject <ResourceID of ServiceBus Queue>
Set-AzServiceBusQueue -InputObject $queue -ForwardTo q1 -ForwardDeadLetteredMessagesTo q2 -DefaultMessageTimeToLive (New-Timespan -Days 365 -Hours 3 -Minutes 11 -Seconds 2)
- Input type of parameters
-DefaultMessageTimeToLive
,-AutoDeleteOnIdle
,-LockDuration
,-DuplicateDetectionHistoryTimeWindow
has been changed from System.String to System.Timespan. Hence, ISO 8601 format for timespan can NO longer be fed as input to these parameters. Please use New-TimeSpan cmdlet object to construct Timespan variables as shown in the example above. Please refer https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-timespan?view=powershell-7.2 to know more about New-TimeSpan.
- Accept pipeline Input for InputObject (InputObject pipelining) can be implemented in the following manner:
Get-AzServiceBusQueue -InputObject <ResourceId of the queue> | Set-AzServiceBusQueue -MessageRetentionInDays 6
-
Property pipelining would be disabled. In other words, None of the cmdlet parameters apart from
-InputObject
would accept pipeline input. -
-InputObject
parameter would no longer support parameter aliasing.
- Positional binding is not supported.
With new release,below cmdlets are marked to be deprecated:
- Add-AzServiceBusIPRule
- Add-AzServiceBusVirtualNetworkRule
- Remove-AzServiceBusIPRule
- Remove-AzServiceBusVirtualNetworkRule
- Remove-AzServiceBusNetworkRuleSet
Use Set-AzServiceBusNetworkRuleSet to add/remove multiple IP/ virtual network rules.
-
Input type of parameter
-InputObject
and Output type of the cmdlet have been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSNetworkRuleSetAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.INetworkRuleSet
. -
Parameter
-IPRule
is changing type fromMicrosoft.Azure.Commands.ServiceBus.Models.PSNWRuleSetIpRulesAttributes[]
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.INwRuleSetIPRules[]
.Please useNew-AzServiceBusIPRuleConfig
cmdlet to construct an in-memory object which can then be fed as input to-IPRule
. -
Parameter
-VirtualNetworkRule
is changing type fromMicrosoft.Azure.Commands.ServiceBus.Models.PSNWRuleSetVirtualNetworkRulesAttributes[]
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.INwRuleSetVirtualNetworkRules[]
.Please useNew-AzServiceBusVirtualNetworkRuleConfig
cmdlet to construct an in-memory object which can then be fed as input to-VirtualNetworkRule
. -
-ResourceId
parameter would be deprecated. Henceforth, resource id can be provided to-InputObject
parameter. -
-InputObject
parameter set would have a change in behaviour. Refer the section to know more.
- Input type of parameter
-InputObject
and Output type of the cmdlet have been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSNetworkRuleSetAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.INetworkRuleSet
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSSharedAccessAuthorizationRuleAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbAuthorizationRule
.
- Input type of parameter
-InputObject
and Output type of the cmdlet has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSSharedAccessAuthorizationRuleAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbAuthorizationRule
. -InputObject
parameter set would have a change in behaviour. Refer the section to know more.-InputObject
parameter would no longer support alias-AuthRuleObj
.
- Input type of parameter
-InputObject
and Output type of the cmdlet has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSSharedAccessAuthorizationRuleAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbAuthorizationRule
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSListKeysAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IAccessKeys
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSListKeysAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IAccessKeys
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSQueueAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbQueue
. -SizeInBytes
and-MessageCount
are readonly parameters and are getting removed.- Parameter
-EnableBatchedOperations
is renamed to-EnableBatchedOperation
. - Input type of parameters
-DefaultMessageTimeToLive
,-AutoDeleteOnIdle
,-LockDuration
,-DuplicateDetectionHistoryTimeWindow
has been changed from System.String to System.Timespan. Hence, ISO 8601 format for timespan can NO longer be fed as input to these parameters. Please use New-TimeSpan cmdlet object to construct Timespan variables. Please refer https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-timespan?view=powershell-7.2 to know more about New-TimeSpan.
- Input type of parameter
-InputObject
and of the cmdlet has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSQueueAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbQueue
. -InputObject
parameter set would have a change in behaviour. Refer the section to know more.-InputObject
parameter would no longer support alias-QueueObj
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSQueueAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbQueue
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSQueueAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbQueue
. - Parameter
-MaxCount
has been removed. Use-Skip
and-Top
for pagination use cases.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSTopicAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbTopic
. - Parameter
-MaxCount
has been removed. Use-Skip
and-Top
for pagination use cases. - Parameter
-ResourceGroupName
would no longer support alias-ResourceGroup
.
- Input type of parameter
-InputObject
and Output type of the cmdlet has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSTopicAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbTopic
. -InputObject
parameter set would have a change in behaviour. Refer the section to know more.-InputObject
parameter would no longer support alias-TopicObj
.- Parameter
-ResourceGroupName
would no longer support alias-ResourceGroup
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSTopicAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbTopic
. -SizeInBytes
is readonly parameter and is getting removed.- Parameter
-EnableBatchedOperations
would be renamed to-EnableBatchedOperation
. - Input type of parameters
-DefaultMessageTimeToLive
,-AutoDeleteOnIdle
,-DuplicateDetectionHistoryTimeWindow
has been changed from System.String to System.Timespan. Hence, ISO 8601 format for timespan can NO longer be fed as input to these parameters. Please use New-TimeSpan cmdlet object to construct Timespan variables. Please refer https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-timespan?view=powershell-7.2 to know more about New-TimeSpan. - Parameter
-ResourceGroupName
would no longer support alias-ResourceGroup
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSTopicAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbTopic
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.- Parameter
-ResourceGroupName
would no longer support alias-ResourceGroup
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSRulesAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IRule
. - Parameter
-MaxCount
has been removed. Use-Skip
and-Top
for pagination use cases.
- Input type of parameter
-InputObject
and Output type of the cmdlet has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSRulesAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IRule
. -InputObject
parameter set would have a change in behaviour. Refer the section to know more.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSRulesAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IRule
. - Parameter
-RequiresPreprocessing
is being renamed to-ActionRequiresPreprocessing
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSRulesAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IRule
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSSubscriptionAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbSubscription
. - Parameter
-MaxCount
has been removed. Use-Skip
and-Top
for pagination use cases.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSSubscriptionAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbSubscription
. - Input type of parameters
-DefaultMessageTimeToLive
,-AutoDeleteOnIdle
,-LockDuration
,-DuplicateDetectionHistoryTimeWindow
has been changed from System.String to System.Timespan. Hence, ISO 8601 format for timespan can NO longer be fed as input to these parameters. Please use New-TimeSpan cmdlet object to construct Timespan variables. Please refer https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-timespan?view=powershell-7.2 to know more about New-TimeSpan.
- Input type of parameter
-InputObject
and Output type of the cmdlet has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSSubscriptionAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbSubscription
. -InputObject
parameter set would have a change in behaviour. Refer the section to know more.-InputObject
parameter would no longer support alias-SubscriptionObj
.
- Input type of parameter
-InputObject
and Output type of the cmdlet has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSSubscriptionAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbSubscription
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSServiceBusPrivateEndpointConnectionAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IPrivateEndpointConnection
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSServiceBusPrivateEndpointConnectionAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IPrivateEndpointConnection
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
-ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSServiceBusPrivateEndpointConnectionAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IPrivateEndpointConnection
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSServiceBusPrivateLinkResourceAttributes[]
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IPrivateLinkResourcesListResult
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSNamespaceAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IArmDisasterRecovery
. - Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSServiceBusDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IArmDisasterRecovery
. -Name
parameter would be removed from-InputObject
parameter set. Henceforth,-InputObject
must contain the ResourceId of Disaster Recovery Configuration alias.-ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSServiceBusDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IArmDisasterRecovery
. -InputObject
and-ResourceId
are not supported during resource creation, hence are being removed.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSServiceBusDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IArmDisasterRecovery
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Parameter
-ResourceId
is being removed. Henceforth, resource id can be provided as input to-InputObject
. - Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSServiceBusDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IArmDisasterRecovery
.
- Parameter
-ResourceId
is being removed. Henceforth, resource id can be provided as input to-InputObject
. - Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSServiceBusDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IArmDisasterRecovery
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSServiceBusDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IMigrationConfigProperties
. - Parameter
-ResourceId
is being removed. Henceforth, resource id can be provided as input to-InputObject
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSServiceBusMigrationConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IMigrationConfigProperties
. - Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSServiceBusMigrationConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IMigrationConfigProperties
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSServiceBusMigrationConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IMigrationConfigProperties
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSServiceBusDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IMigrationConfigProperties
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.ServiceBus.Models.PSServiceBusDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IMigrationConfigProperties
. - Parameter
-ResourceId
is being removed. Henceforth, resource id can be provided as input to-InputObject
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.ServiceBus.Models.PSCheckNameAvailabilityResultAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ICheckNameAvailabilityResult
.