azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

AzureRM.ServiceBus no option to set Action when creating service bus rule

Open Meyce opened this issue 8 years ago • 5 comments

The cmdlet New-AzureServiceBusRule has a parameter -SqlExpression that sets a the SQL filter expression, but there is no option for setting a Sql Action on a rule.

Meyce avatar Sep 07 '18 13:09 Meyce

@v-Ajnava Can you take a look at this issue?

maddieclayton avatar Sep 07 '18 19:09 maddieclayton

right now, you can set the action using set cmdlet with updated Rule object. we will update the New cmdlet to support action. will update the thread once its done.

v-Ajnava avatar Sep 07 '18 23:09 v-Ajnava

@v-Ajnava could you provide an example of how to do this with Set-AzureRmServiceBusRule? I've tried but I keep getting back a Bad Request(400) error.

Meyce avatar Sep 10 '18 12:09 Meyce

@Meyce, please find the example below, compatibilityLevel is default set to 20 and its hardcoded for now, don't update it.

$createdrule1 = New-AzureRmServiceBusRule -ResourceGroupName v-ajnavtest -Namespace pwrtesting -Topic topictest -Subscription testsub -Name testrule1 -SqlExpression "myproperty='test'"

$createdrule1.Action.RequiresPreprocessing = $True $createdrule1.Action.SqlExpression = "SET myaction='testaction'"

Set-AzureRmServiceBusRule -ResourceGroupName v-ajnavtest -Namespace pwrtesting -Topic topictest -Subscription testsub -Name testrule1 -InputObject $createdrule1

to get detailed error if cmdlet fails or bad request please use -debug

hope the above example would help, if any queries please let me know.

v-Ajnava avatar Sep 11 '18 00:09 v-Ajnava

issue is resolved and fix in release from Sep 2018 onward

v-Ajnava avatar May 23 '19 20:05 v-Ajnava