AzureRM.ServiceBus no option to set Action when creating service bus rule
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.
@v-Ajnava Can you take a look at this issue?
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 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, 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.
issue is resolved and fix in release from Sep 2018 onward